mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
22 lines
735 B
TypeScript
22 lines
735 B
TypeScript
import * as ColorsRaw from '@radix-ui/colors';
|
|
|
|
type ExcludeSuffix<T> =
|
|
T extends `${string}${'A' | `${'P3' | 'Dark'}${'' | 'A'}`}` ? never : T;
|
|
export type RadixColor = ExcludeSuffix<keyof typeof ColorsRaw>;
|
|
|
|
export type VarName =
|
|
| `color-${'background' | `panel-${'solid' | 'translucent'}` | 'surface' | 'overlay'}`
|
|
| `radius-${1 | 2 | 3 | 4 | 5 | 6 | 'full'}`
|
|
| `space-${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`
|
|
| `shadow-${1 | 2 | 3 | 4 | 5 | 6}`
|
|
| `${RadixColor | 'accent' | 'gray' | 'black' | 'white'}-${
|
|
| `${'' | 'a'}${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12}`
|
|
| 'surface'
|
|
| 'indicator'
|
|
| 'track'
|
|
| 'contrast'}`;
|
|
|
|
export function Var(name: VarName) {
|
|
return `var(--${name})`;
|
|
}
|