(value: ColorValue, type: ColorType = 'default', version = 5)
| 175 | |
| 176 | type ColorType = 'default' | 'background' | 'border' | 'icon' | 'status'; |
| 177 | function colorValue(value: ColorValue, type: ColorType = 'default', version = 5) { |
| 178 | if (version > 5) { |
| 179 | return `var(--spectrum-${value}, var(--spectrum-semantic-${value}-color-${type}))`; |
| 180 | } |
| 181 | |
| 182 | return `var(--spectrum-legacy-color-${value}, var(--spectrum-global-color-${value}, var(--spectrum-semantic-${value}-color-${type})))`; |
| 183 | } |
| 184 | |
| 185 | function backgroundColorValue(value: BackgroundColorValue, version = 5): string | undefined { |
| 186 | if (!value) { |
no outgoing calls
no test coverage detected