@@ -13,12 +13,14 @@ export type GlobalToken = typeof tokens.global
13
13
/**
14
14
* FIXME: Separate functional and semantic tokens?
15
15
*/
16
- export type ThemeToken = typeof tokens . lightTheme | typeof tokens . darkTheme
16
+ export type SemanticToken = typeof tokens . lightTheme | typeof tokens . darkTheme
17
17
18
18
// NOTE: (@ed) Do not remove alpha- prefix to match CSS variable names
19
19
export type FlattenGlobalToken = ExtractKeys < GlobalToken [ keyof GlobalToken ] >
20
- export type FlattenThemeToken = ExtractKeys < ThemeToken [ keyof ThemeToken ] >
21
- export type FlattenAllToken = FlattenGlobalToken | FlattenThemeToken
20
+ export type FlattenSemanticToken = ExtractKeys <
21
+ SemanticToken [ keyof SemanticToken ]
22
+ >
23
+ export type FlattenAllToken = FlattenGlobalToken | FlattenSemanticToken
22
24
23
25
export type GlobalColor = RemovePrefix <
24
26
'alpha-color' ,
@@ -28,13 +30,28 @@ export type GlobalColor = RemovePrefix<
28
30
/**
29
31
* Functional & Semantic color tokens
30
32
*/
31
- export type ThemeColor = RemovePrefix < 'alpha-color' , keyof ThemeToken [ 'color' ] >
33
+ export type BaseSemanticColor = RemovePrefix <
34
+ 'alpha-color' ,
35
+ keyof SemanticToken [ 'color' ]
36
+ >
32
37
33
- export type BackgroundFunctionalColor = StartsWithPrefix < 'bg' , ThemeColor >
34
- export type ForegroundFunctionalColor = StartsWithPrefix < 'fg' , ThemeColor >
35
- export type SurfaceFunctionalColor = StartsWithPrefix < 'surface' , ThemeColor >
36
- export type ShadowFunctionalColor = StartsWithPrefix < 'shadow' , ThemeColor >
37
- export type DimFunctionalColor = StartsWithPrefix < 'dim' , ThemeColor >
38
+ export type BackgroundFunctionalColor = StartsWithPrefix <
39
+ 'bg' ,
40
+ BaseSemanticColor
41
+ >
42
+ export type ForegroundFunctionalColor = StartsWithPrefix <
43
+ 'fg' ,
44
+ BaseSemanticColor
45
+ >
46
+ export type SurfaceFunctionalColor = StartsWithPrefix <
47
+ 'surface' ,
48
+ BaseSemanticColor
49
+ >
50
+ export type ShadowFunctionalColor = StartsWithPrefix <
51
+ 'shadow' ,
52
+ BaseSemanticColor
53
+ >
54
+ export type DimFunctionalColor = StartsWithPrefix < 'dim' , BaseSemanticColor >
38
55
39
56
export type FunctionalColor =
40
57
| BackgroundFunctionalColor
@@ -45,7 +62,7 @@ export type FunctionalColor =
45
62
46
63
export type SemanticColor = StartsWithPrefix <
47
64
'primary' | 'critical' | 'warning' | 'accent' | 'success' ,
48
- ThemeColor
65
+ BaseSemanticColor
49
66
>
50
67
51
68
export type Color = GlobalColor | FunctionalColor | SemanticColor
@@ -65,8 +82,8 @@ export type GlobalGradient = RemovePrefix<
65
82
keyof GlobalToken [ 'gradient' ]
66
83
>
67
84
68
- export type Shadow = RemovePrefix < 'alpha-shadow' , keyof ThemeToken [ 'shadow' ] >
85
+ export type Shadow = RemovePrefix < 'alpha-shadow' , keyof SemanticToken [ 'shadow' ] >
69
86
export type FunctionalGradient = RemovePrefix <
70
87
'alpha-gradient' ,
71
- keyof ThemeToken [ 'gradient' ]
88
+ keyof SemanticToken [ 'gradient' ]
72
89
>
0 commit comments