MCPcopy
hub / github.com/mountain-loop/yaak / buttonSolidColorVariables

Function buttonSolidColorVariables

packages/theme/src/window.ts:146–166  ·  view source on GitHub ↗
(
  color: YaakColor | null,
  isDefault = false,
)

Source from the content-addressed store, hash-verified

144}
145
146function buttonSolidColorVariables(
147 color: YaakColor | null,
148 isDefault = false,
149): Partial<CSSVariables> {
150 if (color == null) return {};
151
152 const theme: Partial<ThemeComponentColors> = {
153 text: "white",
154 surface: color.lower(0.3).css(),
155 surfaceHighlight: color.lower(0.1).css(),
156 border: color.css(),
157 };
158
159 if (isDefault) {
160 theme.text = undefined;
161 theme.surface = undefined;
162 theme.surfaceHighlight = color.lift(0.08).css();
163 }
164
165 return theme;
166}
167
168function buttonBorderColorVariables(
169 color: YaakColor | null,

Callers 2

buttonCSSFunction · 0.85
getThemeCSSFunction · 0.85

Calls 3

cssMethod · 0.80
lowerMethod · 0.80
liftMethod · 0.80

Tested by

no test coverage detected