@sanity/ui 2.0.0-alpha.34 → 2.0.0-alpha.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/index.cjs.mjs +4 -3
  2. package/dist/index.d.ts +29 -22
  3. package/dist/index.esm.js +397 -518
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +413 -534
  6. package/dist/index.js.map +1 -1
  7. package/dist/theme.cjs.mjs +10 -4
  8. package/dist/theme.d.ts +489 -201
  9. package/dist/theme.esm.js +2934 -2748
  10. package/dist/theme.esm.js.map +1 -1
  11. package/dist/theme.js +2943 -2751
  12. package/dist/theme.js.map +1 -1
  13. package/package.json +3 -3
  14. package/src/core/_compat.ts +7 -7
  15. package/src/core/components/dialog/dialog.tsx +5 -5
  16. package/src/core/components/dialog/styles.ts +4 -5
  17. package/src/core/components/hotkeys/hotkeys.tsx +4 -2
  18. package/src/core/components/menu/__workshop__/avatarMenu.tsx +50 -0
  19. package/src/core/components/menu/__workshop__/index.ts +5 -0
  20. package/src/core/components/menu/menuItem.tsx +7 -1
  21. package/src/core/components/skeleton/textSkeleton.tsx +12 -14
  22. package/src/core/components/tree/style.ts +14 -17
  23. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +3 -3
  24. package/src/core/hooks/useMediaIndex/useMediaIndex.ts +2 -3
  25. package/src/core/primitives/_selectable/style.ts +18 -18
  26. package/src/core/primitives/avatar/avatar.tsx +3 -3
  27. package/src/core/primitives/avatar/avatarCounter.tsx +4 -4
  28. package/src/core/primitives/avatar/avatarStack.tsx +2 -2
  29. package/src/core/primitives/avatar/styles.ts +7 -8
  30. package/src/core/primitives/avatar/types.ts +2 -2
  31. package/src/core/primitives/badge/__workshop__/props.tsx +1 -1
  32. package/src/core/primitives/badge/__workshop__/tones.tsx +1 -1
  33. package/src/core/primitives/badge/badge.tsx +1 -1
  34. package/src/core/primitives/badge/styles.ts +5 -6
  35. package/src/core/primitives/button/button.tsx +3 -4
  36. package/src/core/primitives/button/styles.ts +22 -23
  37. package/src/core/primitives/card/__workshop__/selected.tsx +15 -15
  38. package/src/core/primitives/card/card.tsx +1 -1
  39. package/src/core/primitives/card/styles.ts +22 -22
  40. package/src/core/primitives/checkbox/styles.ts +21 -22
  41. package/src/core/primitives/code/styles.ts +4 -1
  42. package/src/core/primitives/container/styles.ts +2 -3
  43. package/src/core/primitives/heading/styles.ts +4 -2
  44. package/src/core/primitives/inline/styles.ts +6 -6
  45. package/src/core/primitives/kbd/kbd.tsx +7 -11
  46. package/src/core/primitives/label/styles.ts +4 -3
  47. package/src/core/primitives/popover/helpers.ts +3 -4
  48. package/src/core/primitives/popover/popover.tsx +8 -4
  49. package/src/core/primitives/popover/types.ts +1 -1
  50. package/src/core/primitives/radio/styles.ts +17 -19
  51. package/src/core/primitives/select/styles.ts +27 -32
  52. package/src/core/primitives/stack/styles.ts +2 -3
  53. package/src/core/primitives/switch/__workshop__/props.tsx +11 -31
  54. package/src/core/primitives/switch/styles.ts +18 -21
  55. package/src/core/primitives/text/__workshop__/colored.tsx +10 -10
  56. package/src/core/primitives/text/styles.ts +9 -4
  57. package/src/core/primitives/tooltip/tooltip.tsx +3 -3
  58. package/src/core/styles/border/borderStyle.ts +6 -11
  59. package/src/core/styles/box/boxStyle.ts +5 -9
  60. package/src/core/styles/card/_cardColorStyle.ts +99 -0
  61. package/src/core/styles/card/index.ts +1 -0
  62. package/src/core/styles/flex/flexItemStyle.ts +2 -3
  63. package/src/core/styles/flex/flexStyle.ts +6 -11
  64. package/src/core/styles/font/responsiveFont.ts +4 -4
  65. package/src/core/styles/font/textAlignStyle.ts +3 -3
  66. package/src/core/styles/grid/gridItemStyle.ts +7 -13
  67. package/src/core/styles/grid/gridStyle.ts +9 -17
  68. package/src/core/styles/helpers.ts +5 -3
  69. package/src/core/styles/input/responsiveInputPaddingStyle.ts +6 -6
  70. package/src/core/styles/input/textInputStyle.ts +36 -40
  71. package/src/core/styles/margin/marginsStyle.test.ts +2 -3
  72. package/src/core/styles/padding/paddingStyle.test.ts +2 -3
  73. package/src/core/styles/radius/radiusStyle.ts +2 -3
  74. package/src/core/styles/shadow/shadowStyle.ts +4 -5
  75. package/src/core/theme/__workshop__/build/Root.tsx +24 -20
  76. package/src/core/theme/__workshop__/build/story.tsx +22 -26
  77. package/src/core/theme/__workshop__/canvas.tsx +21 -40
  78. package/src/core/theme/theme.test.tsx +2 -35
  79. package/src/core/theme/themeColorProvider.tsx +2 -2
  80. package/src/core/theme/themeContext.ts +2 -2
  81. package/src/core/theme/themeProvider.tsx +25 -25
  82. package/src/core/theme/types.ts +3 -2
  83. package/src/core/theme/useRootTheme.ts +1 -9
  84. package/src/core/theme/useTheme.ts +8 -1
  85. package/src/core/types/card.ts +2 -2
  86. package/src/core/utils/arrow/arrow.tsx +3 -3
  87. package/src/core/utils/elementQuery/elementQuery.tsx +3 -3
  88. package/src/core/utils/virtualList/virtualList.tsx +2 -2
  89. package/src/theme/build/_deprecated/color/muted/createMuted.ts +2 -2
  90. package/src/theme/build/buildColorTheme.test.ts +14 -15
  91. package/src/theme/build/buildColorTheme.ts +239 -292
  92. package/src/theme/build/buildTheme.test.ts +9 -7
  93. package/src/theme/build/buildTheme.ts +12 -9
  94. package/src/theme/build/colorToken.ts +3 -1
  95. package/src/theme/build/lib/color-fns/contrastRatio.ts +1 -0
  96. package/src/theme/build/lib/isRecord.ts +3 -0
  97. package/src/theme/build/merge.ts +18 -13
  98. package/src/theme/build/renderColorTheme.ts +205 -213
  99. package/src/theme/build/renderColorValue.ts +15 -8
  100. package/src/theme/build/resolveColorTokens.ts +177 -198
  101. package/src/theme/build/theme.test.ts +27 -0
  102. package/src/theme/config/helpers.ts +16 -8
  103. package/src/theme/config/system.ts +46 -17
  104. package/src/theme/config/tokens/color/types.ts +55 -32
  105. package/src/theme/config/tokens/types.ts +11 -4
  106. package/src/theme/config/types.ts +5 -11
  107. package/src/theme/{build/defaults → defaults}/colorPalette.ts +1 -1
  108. package/src/theme/{build/defaults → defaults}/colorTokens.ts +189 -136
  109. package/src/theme/{build/defaults → defaults}/config.ts +14 -12
  110. package/src/theme/{build/defaults → defaults}/fonts.ts +6 -6
  111. package/src/theme/getScopedTheme.ts +81 -0
  112. package/src/theme/index.ts +9 -1
  113. package/src/theme/system/avatar.ts +1 -1
  114. package/src/theme/system/color/_constants.ts +11 -11
  115. package/src/theme/system/color/_system.ts +10 -71
  116. package/src/theme/system/color/avatar.ts +22 -10
  117. package/src/theme/system/color/badge.ts +18 -7
  118. package/src/theme/system/color/button.ts +17 -23
  119. package/src/theme/system/color/color.ts +34 -0
  120. package/src/theme/system/color/index.ts +3 -10
  121. package/src/theme/system/color/input.ts +13 -11
  122. package/src/theme/system/color/kbd.ts +3 -3
  123. package/src/theme/system/color/selectable.ts +13 -19
  124. package/src/theme/system/color/shadow.ts +7 -0
  125. package/src/theme/system/color/state.ts +37 -0
  126. package/src/theme/system/css.ts +9 -0
  127. package/src/theme/system/focusRing.ts +7 -0
  128. package/src/theme/system/index.ts +5 -1
  129. package/src/theme/system/input.ts +1 -1
  130. package/src/theme/system/layer.ts +1 -2
  131. package/src/theme/system/shadow.ts +1 -0
  132. package/src/theme/system/styles.ts +19 -0
  133. package/src/theme/system/theme.ts +128 -0
  134. package/src/theme/system/{color → v0/color}/_generic.ts +2 -1
  135. package/src/theme/system/v0/color/_system.ts +13 -0
  136. package/src/theme/system/{color → v0/color}/base.ts +2 -0
  137. package/src/theme/system/v0/color/button.ts +42 -0
  138. package/src/theme/system/{color → v0/color}/card.ts +2 -1
  139. package/src/theme/system/v0/color/color.ts +40 -0
  140. package/src/theme/system/v0/color/index.ts +11 -0
  141. package/src/theme/system/v0/color/input.ts +34 -0
  142. package/src/theme/system/{color/_deprecated → v0/color}/muted.ts +1 -1
  143. package/src/theme/system/v0/color/selectable.ts +31 -0
  144. package/src/theme/system/{color/_deprecated → v0/color}/solid.ts +1 -1
  145. package/src/theme/system/v0/color/spot.ts +13 -0
  146. package/src/theme/system/v0/index.ts +1 -0
  147. package/src/theme/versioning/getTheme_v2.ts +38 -0
  148. package/src/theme/versioning/index.ts +5 -0
  149. package/src/theme/versioning/is_v0.ts +6 -0
  150. package/src/theme/versioning/is_v2.ts +6 -0
  151. package/src/theme/versioning/themeColor_v0_v2.ts +217 -0
  152. package/src/theme/versioning/v0_v2.ts +72 -0
  153. package/src/theme/versioning/v2_v0.ts +126 -0
  154. package/src/core/styles/colorVars/colorVarsStyle.ts +0 -43
  155. package/src/core/styles/colorVars/index.ts +0 -1
  156. package/src/core/theme/defaults.ts +0 -7
  157. package/src/theme/system/_system.ts +0 -95
  158. package/src/theme/system/color/_deprecated/spot.ts +0 -13
  159. package/src/theme/themes/studio/config.ts +0 -69
  160. package/src/theme/themes/studio/fonts.ts +0 -219
  161. package/src/theme/themes/studio/index.ts +0 -1
  162. package/src/theme/themes/studio/studioTheme.test.ts +0 -27
  163. package/src/theme/themes/studio/studioTheme.ts +0 -8
@@ -1,256 +1,260 @@
1
- import {ThemeColorTokenValue, ThemeConfig} from '../config'
1
+ import {ThemeColorBadgeTokens, ThemeColorStateTokens, ThemeConfig} from '../config'
2
2
  import {
3
3
  THEME_COLOR_BUTTON_MODES,
4
4
  THEME_COLOR_STATES,
5
5
  THEME_COLOR_STATE_TONES,
6
6
  ThemeColorAvatarColorKey,
7
- ThemeColorBaseToneKey,
7
+ ThemeColorCardToneKey,
8
8
  ThemeColorButtonModeKey,
9
9
  ThemeColorStateKey,
10
10
  ThemeColorStateToneKey,
11
- ThemeColor,
12
- ThemeColorAvatar,
13
- ThemeColorBadge,
14
- ThemeColorButton,
15
- ThemeColorButtonStates,
16
- ThemeColorButtonTones,
17
- ThemeColorCard,
18
- ThemeColorGenericState,
19
- ThemeColorInput,
20
- ThemeColorInputState,
21
- ThemeColorInputStates,
22
- ThemeColorScheme,
23
- ThemeColorSchemes,
24
- ThemeColorSpot,
11
+ ThemeColorAvatar_v2,
12
+ ThemeColorBadge_v2,
25
13
  ThemeColorSyntax,
14
+ ThemeColorSchemes_v2,
15
+ ThemeColorScheme_v2,
16
+ ThemeColorCard_v2,
17
+ ThemeColorSchemeKey,
18
+ ThemeColorShadow,
19
+ ThemeColorState_v2,
20
+ ThemeColorButton_v2,
21
+ ThemeColorButtonTones_v2,
22
+ ThemeColorButtonStates_v2,
23
+ ThemeColorAvatarHue_v2,
24
+ ThemeColorInput_v2,
25
+ ThemeColorInputStates_v2,
26
+ ThemeColorInputState_v2,
26
27
  } from '../system'
27
28
  import {ColorTokenContext, resolveColorTokenValue as _color} from './colorToken'
28
29
  import {resolveColorTokens} from './resolveColorTokens'
29
30
 
30
- const DEFAULT_COLOR_TOKEN_VALUE: ThemeColorTokenValue = ['500', '500']
31
+ export function buildColorTheme(config?: ThemeConfig): ThemeColorSchemes_v2 {
32
+ const resolvedConfig: ThemeConfig = {
33
+ ...config,
34
+ color: resolveColorTokens(config?.color),
35
+ }
31
36
 
32
- export function buildColorTheme(config?: ThemeConfig): ThemeColorSchemes {
33
37
  return {
34
- light: buildColorScheme({scheme: 'light'}, config),
35
- dark: buildColorScheme({scheme: 'dark'}, config),
38
+ light: buildColorScheme({scheme: 'light'}, resolvedConfig),
39
+ dark: buildColorScheme({scheme: 'dark'}, resolvedConfig),
36
40
  }
37
41
  }
38
42
 
39
- export function buildColorScheme(
40
- options: {scheme: 'light' | 'dark'},
41
- config?: ThemeConfig,
42
- ): ThemeColorScheme {
43
+ function buildColorScheme(
44
+ options: {scheme: ThemeColorSchemeKey},
45
+ config: ThemeConfig,
46
+ ): ThemeColorScheme_v2 {
43
47
  const {scheme} = options
44
48
 
45
- const resolvedConfig: ThemeConfig = {
46
- ...config,
47
- color: resolveColorTokens(config?.color),
48
- }
49
-
50
49
  return {
51
- transparent: buildBaseColorTheme({scheme, tone: 'transparent'}, resolvedConfig),
52
- default: buildBaseColorTheme({scheme, tone: 'default'}, resolvedConfig),
53
- primary: buildBaseColorTheme({scheme, tone: 'primary'}, resolvedConfig),
54
- positive: buildBaseColorTheme({scheme, tone: 'positive'}, resolvedConfig),
55
- caution: buildBaseColorTheme({scheme, tone: 'caution'}, resolvedConfig),
56
- critical: buildBaseColorTheme({scheme, tone: 'critical'}, resolvedConfig),
50
+ transparent: buildCardColorTheme({scheme, tone: 'transparent'}, config),
51
+ default: buildCardColorTheme({scheme, tone: 'default'}, config),
52
+ primary: buildCardColorTheme({scheme, tone: 'primary'}, config),
53
+ positive: buildCardColorTheme({scheme, tone: 'positive'}, config),
54
+ caution: buildCardColorTheme({scheme, tone: 'caution'}, config),
55
+ critical: buildCardColorTheme({scheme, tone: 'critical'}, config),
57
56
  }
58
57
  }
59
58
 
60
- export function buildBaseColorTheme(
61
- options: {scheme: 'light' | 'dark'; tone: ThemeColorBaseToneKey},
59
+ function buildCardColorTheme(
60
+ options: {scheme: ThemeColorSchemeKey; tone: ThemeColorCardToneKey},
62
61
  config?: ThemeConfig,
63
- ): ThemeColor {
62
+ ): ThemeColorCard_v2 {
64
63
  const {scheme, tone} = options
65
64
  const tokens = config?.color?.base?.[tone]
66
65
  const hue = tokens?._hue || 'gray'
67
66
  const context: ColorTokenContext = {hue, scheme}
68
- const bg = _color(context, tokens?.bg || DEFAULT_COLOR_TOKEN_VALUE)
69
- const blendMode = tokens?._blend || ['screen', 'multiply']
70
-
71
- // Build `button` color theme
72
- // Also used for `solid` and `muted` color themes
73
- const button = buildButtonColorTheme({scheme}, config)
74
-
75
- const selectable = buildSelectableColorTheme({scheme}, config)
76
-
77
- const _dark = scheme === 'dark'
67
+ const blendMode = tokens?._blend || ['multiply', 'screen']
78
68
 
79
69
  return {
80
70
  _blend: blendMode[scheme === 'light' ? 0 : 1],
81
- _dark,
82
- avatar: buildAvatarColorTheme({scheme}, config),
83
- badge: buildBadgeColorTheme({scheme}, config),
84
- base: {
85
- bg,
86
- fg: _color(context, tokens?.fg || DEFAULT_COLOR_TOKEN_VALUE),
87
- border: _color(context, tokens?.border || DEFAULT_COLOR_TOKEN_VALUE),
88
- focusRing: _color(context, tokens?.focusRing || DEFAULT_COLOR_TOKEN_VALUE),
89
- shadow: {
90
- outline: _color(context, tokens?.shadow?.outline || DEFAULT_COLOR_TOKEN_VALUE),
91
- umbra: _color(context, tokens?.shadow?.umbra || DEFAULT_COLOR_TOKEN_VALUE),
92
- penumbra: _color(context, tokens?.shadow?.penumbra || DEFAULT_COLOR_TOKEN_VALUE),
93
- ambient: _color(context, tokens?.shadow?.ambient || DEFAULT_COLOR_TOKEN_VALUE),
94
- },
95
- skeleton: {
96
- from: _color(context, tokens?.skeleton?.from || DEFAULT_COLOR_TOKEN_VALUE),
97
- to: _color(context, tokens?.skeleton?.to || DEFAULT_COLOR_TOKEN_VALUE),
98
- },
71
+ _dark: scheme === 'dark',
72
+ accent: {
73
+ fg: _color(context, tokens?.accent?.fg),
99
74
  },
100
- button,
101
- // card: buildCardColorTheme({scheme, baseTone: tone}, config),
102
- card: selectable.default satisfies ThemeColorCard,
75
+ avatar: buildAvatarColorTheme({scheme}, tokens),
76
+ backdrop: _color(context, tokens?.backdrop),
77
+ badge: buildBadgeColorTheme(tokens?.badge, {scheme}, config),
78
+ bg: _color(context, tokens?.bg),
79
+ border: _color(context, tokens?.border),
80
+ button: buildButtonColorTheme({scheme}, config),
81
+ code: {
82
+ bg: _color(context, tokens?.code?.bg),
83
+ fg: _color(context, tokens?.code?.fg),
84
+ },
85
+ fg: _color(context, tokens?.fg),
86
+ focusRing: _color(context, tokens?.focusRing),
87
+ icon: _color(context, tokens?.icon),
103
88
  input: buildInputColorTheme({scheme, tone}, config),
104
89
  kbd: {
105
- _blend: (config?.color?.kbd?._blend || ['multiply', 'screen'])[scheme === 'light' ? 0 : 1],
106
- bg: _color(context, config?.color?.kbd?.bg || DEFAULT_COLOR_TOKEN_VALUE),
107
- fg: _color(context, config?.color?.kbd?.fg || DEFAULT_COLOR_TOKEN_VALUE),
108
- border: _color(context, config?.color?.kbd?.border || DEFAULT_COLOR_TOKEN_VALUE),
90
+ bg: _color(context, tokens?.kbd?.bg),
91
+ fg: _color(context, tokens?.kbd?.fg),
92
+ border: _color(context, tokens?.kbd?.border),
109
93
  },
110
- spot: buildSpotColorTheme({scheme}, config),
111
- syntax: buildSyntaxColorTheme({scheme}, config),
112
- solid: {
113
- ...button.default,
114
- transparent: button.default.default,
94
+ link: {
95
+ fg: _color(context, tokens?.link?.fg),
115
96
  },
116
97
  muted: {
117
- ...button.bleed,
118
- transparent: button.bleed.default,
98
+ bg: _color(context, tokens?.muted?.bg),
99
+ fg: _color(context, tokens?.muted?.fg),
100
+ },
101
+ selectable: buildSelectableColorTheme({scheme}, config),
102
+ shadow: buildShadowColorTheme({scheme, tone}, config),
103
+ skeleton: {
104
+ from: _color(context, tokens?.skeleton?.from),
105
+ to: _color(context, tokens?.skeleton?.to),
119
106
  },
120
- selectable,
107
+ syntax: buildSyntaxColorTheme({scheme}, config),
108
+ }
109
+ }
121
110
 
122
- dark: _dark, // deprecated
111
+ function buildShadowColorTheme(
112
+ options: {scheme: ThemeColorSchemeKey; tone: ThemeColorCardToneKey},
113
+ config?: ThemeConfig,
114
+ ): ThemeColorShadow {
115
+ const {scheme, tone} = options
116
+ const tokens = config?.color?.base?.[tone]
117
+ const hue = tokens?._hue || 'gray'
118
+ const context: ColorTokenContext = {hue, scheme}
119
+
120
+ return {
121
+ outline: _color(context, tokens?.shadow?.outline),
122
+ umbra: _color(context, tokens?.shadow?.umbra),
123
+ penumbra: _color(context, tokens?.shadow?.penumbra),
124
+ ambient: _color(context, tokens?.shadow?.ambient),
123
125
  }
124
126
  }
125
127
 
126
128
  function buildAvatarColorTheme(
127
- options: {scheme: 'light' | 'dark'},
128
- config?: ThemeConfig,
129
- ): ThemeColorAvatar {
129
+ options: {scheme: ThemeColorSchemeKey},
130
+ stateTokens?: ThemeColorStateTokens,
131
+ ): ThemeColorAvatar_v2 {
130
132
  const {scheme} = options
131
133
 
132
134
  return {
133
- gray: _buildAvatarColorTheme({color: 'gray', scheme}, config),
134
- blue: _buildAvatarColorTheme({color: 'blue', scheme}, config),
135
- purple: _buildAvatarColorTheme({color: 'purple', scheme}, config),
136
- magenta: _buildAvatarColorTheme({color: 'magenta', scheme}, config),
137
- red: _buildAvatarColorTheme({color: 'red', scheme}, config),
138
- orange: _buildAvatarColorTheme({color: 'orange', scheme}, config),
139
- yellow: _buildAvatarColorTheme({color: 'yellow', scheme}, config),
140
- green: _buildAvatarColorTheme({color: 'green', scheme}, config),
141
- cyan: _buildAvatarColorTheme({color: 'cyan', scheme}, config),
135
+ gray: _buildAvatarColorTheme({color: 'gray', scheme}, stateTokens),
136
+ blue: _buildAvatarColorTheme({color: 'blue', scheme}, stateTokens),
137
+ purple: _buildAvatarColorTheme({color: 'purple', scheme}, stateTokens),
138
+ magenta: _buildAvatarColorTheme({color: 'magenta', scheme}, stateTokens),
139
+ red: _buildAvatarColorTheme({color: 'red', scheme}, stateTokens),
140
+ orange: _buildAvatarColorTheme({color: 'orange', scheme}, stateTokens),
141
+ yellow: _buildAvatarColorTheme({color: 'yellow', scheme}, stateTokens),
142
+ green: _buildAvatarColorTheme({color: 'green', scheme}, stateTokens),
143
+ cyan: _buildAvatarColorTheme({color: 'cyan', scheme}, stateTokens),
142
144
  }
143
145
  }
144
146
 
145
147
  function _buildAvatarColorTheme(
146
- options: {color: ThemeColorAvatarColorKey; scheme: 'light' | 'dark'},
147
- config?: ThemeConfig,
148
- ): ThemeColorAvatar['gray'] {
148
+ options: {color: ThemeColorAvatarColorKey; scheme: ThemeColorSchemeKey},
149
+ stateTokens?: ThemeColorStateTokens,
150
+ ): ThemeColorAvatarHue_v2 {
149
151
  const {color, scheme} = options
150
- const tokens = config?.color?.avatar?.[color]
152
+ const tokens = stateTokens?.avatar?.[color]
151
153
  const context: ColorTokenContext = {hue: tokens?._hue || 'gray', scheme}
152
- const blendMode = tokens?._blend || ['multiply', 'screen']
154
+ const blendMode = tokens?._blend || ['screen', 'multiply']
153
155
 
154
156
  return {
155
157
  _blend: blendMode[scheme === 'light' ? 0 : 1],
156
- bg: _color(context, tokens?.bg || DEFAULT_COLOR_TOKEN_VALUE),
157
- fg: _color(context, tokens?.fg || DEFAULT_COLOR_TOKEN_VALUE),
158
+ bg: _color(context, tokens?.bg),
159
+ fg: _color(context, tokens?.fg),
158
160
  }
159
161
  }
160
162
 
161
163
  function buildBadgeColorTheme(
162
- options: {scheme: 'light' | 'dark'},
164
+ tokens: ThemeColorBadgeTokens | undefined,
165
+ options: {scheme: ThemeColorSchemeKey},
163
166
  config?: ThemeConfig,
164
- ): ThemeColorBadge {
167
+ ): ThemeColorBadge_v2 {
165
168
  const {scheme} = options
166
169
 
167
170
  return {
168
- default: _buildBadgeColorTheme({scheme, tone: 'default'}, config),
169
- primary: _buildBadgeColorTheme({scheme, tone: 'primary'}, config),
170
- positive: _buildBadgeColorTheme({scheme, tone: 'positive'}, config),
171
- caution: _buildBadgeColorTheme({scheme, tone: 'caution'}, config),
172
- critical: _buildBadgeColorTheme({scheme, tone: 'critical'}, config),
171
+ default: _buildBadgeColorTheme(tokens, {scheme, tone: 'default'}, config),
172
+ primary: _buildBadgeColorTheme(tokens, {scheme, tone: 'primary'}, config),
173
+ positive: _buildBadgeColorTheme(tokens, {scheme, tone: 'positive'}, config),
174
+ caution: _buildBadgeColorTheme(tokens, {scheme, tone: 'caution'}, config),
175
+ critical: _buildBadgeColorTheme(tokens, {scheme, tone: 'critical'}, config),
173
176
  }
174
177
  }
175
178
 
176
179
  function _buildBadgeColorTheme(
177
- options: {scheme: 'light' | 'dark'; tone: ThemeColorStateToneKey},
180
+ parentTokens: ThemeColorBadgeTokens | undefined,
181
+ options: {scheme: ThemeColorSchemeKey; tone: ThemeColorStateToneKey},
178
182
  config?: ThemeConfig,
179
- ): ThemeColorBadge['default'] {
183
+ ): ThemeColorBadge_v2['default'] {
180
184
  const {scheme, tone} = options
181
- const tokens = config?.color?.badge?.[tone]
185
+ const tokens = parentTokens?.[tone]
182
186
  const hue = tokens?._hue || config?.color?.base?.[tone]?._hue || 'gray'
183
187
  const context: ColorTokenContext = {hue, scheme}
184
- const blendMode = tokens?._blend || ['multiply', 'screen']
185
188
 
186
189
  return {
187
- _blend: blendMode[scheme === 'light' ? 0 : 1],
188
- bg: _color(context, tokens?.bg || DEFAULT_COLOR_TOKEN_VALUE),
189
- fg: _color(context, tokens?.fg || DEFAULT_COLOR_TOKEN_VALUE),
190
+ bg: _color(context, tokens?.bg),
191
+ fg: _color(context, tokens?.fg),
192
+ dot: _color(context, tokens?.dot),
193
+ icon: _color(context, tokens?.icon),
190
194
  }
191
195
  }
192
196
 
193
197
  function buildButtonColorTheme(
194
- options: {scheme: 'light' | 'dark'},
198
+ options: {scheme: ThemeColorSchemeKey},
195
199
  config?: ThemeConfig,
196
- ): ThemeColorButton {
200
+ ): ThemeColorButton_v2 {
197
201
  const {scheme} = options
198
202
 
199
- const modes: Partial<ThemeColorButton> = {}
203
+ const modes: Partial<ThemeColorButton_v2> = {}
200
204
 
201
205
  for (const mode of THEME_COLOR_BUTTON_MODES) {
202
206
  modes[mode] = buildButtonTonesColorTheme({scheme, mode}, config)
203
207
  }
204
208
 
205
- return modes as ThemeColorButton
209
+ return modes as ThemeColorButton_v2
206
210
  }
207
211
 
208
212
  function buildButtonTonesColorTheme(
209
213
  options: {
210
- scheme: 'light' | 'dark'
214
+ scheme: ThemeColorSchemeKey
211
215
  mode: ThemeColorButtonModeKey
212
216
  },
213
217
  config?: ThemeConfig,
214
- ): ThemeColorButtonTones {
218
+ ): ThemeColorButtonTones_v2 {
215
219
  const {mode, scheme} = options
216
220
 
217
- const tones: Partial<ThemeColorButtonTones> = {}
221
+ const tones: Partial<ThemeColorButtonTones_v2> = {}
218
222
 
219
223
  for (const tone of THEME_COLOR_STATE_TONES) {
220
224
  tones[tone] = buildButtonStatesColorTheme({mode, scheme, tone}, config)
221
225
  }
222
226
 
223
- return tones as ThemeColorButtonTones
227
+ return tones as ThemeColorButtonTones_v2
224
228
  }
225
229
 
226
230
  function buildButtonStatesColorTheme(
227
231
  options: {
228
232
  mode: ThemeColorButtonModeKey
229
- scheme: 'light' | 'dark'
233
+ scheme: ThemeColorSchemeKey
230
234
  tone: ThemeColorStateToneKey
231
235
  },
232
236
  config?: ThemeConfig,
233
- ): ThemeColorButtonStates {
237
+ ): ThemeColorButtonStates_v2 {
234
238
  const {mode, scheme, tone} = options
235
239
 
236
- const states: Partial<ThemeColorButtonStates> = {}
240
+ const states: Partial<ThemeColorButtonStates_v2> = {}
237
241
 
238
242
  for (const state of THEME_COLOR_STATES) {
239
243
  states[state] = buildButtonStateColorTheme({mode, tone, scheme, state}, config)
240
244
  }
241
245
 
242
- return states as ThemeColorButtonStates
246
+ return states as ThemeColorButtonStates_v2
243
247
  }
244
248
 
245
249
  function buildButtonStateColorTheme(
246
250
  options: {
247
251
  mode: ThemeColorButtonModeKey
248
252
  tone: ThemeColorStateToneKey
249
- scheme: 'light' | 'dark'
253
+ scheme: ThemeColorSchemeKey
250
254
  state: ThemeColorStateKey
251
255
  },
252
256
  config?: ThemeConfig,
253
- ): ThemeColorGenericState {
257
+ ): ThemeColorState_v2 {
254
258
  const {mode, tone, scheme, state} = options
255
259
  const tokens = config?.color?.button?.[mode]?.[tone]?.[state]
256
260
  const hue = tokens?._hue || 'gray'
@@ -259,87 +263,42 @@ function buildButtonStateColorTheme(
259
263
 
260
264
  return {
261
265
  _blend: blendMode[scheme === 'light' ? 0 : 1],
262
- bg: _color(context, tokens?.bg || DEFAULT_COLOR_TOKEN_VALUE),
263
- bg2: _color(context, tokens?.bg2 || DEFAULT_COLOR_TOKEN_VALUE),
264
- fg: _color(context, tokens?.fg || DEFAULT_COLOR_TOKEN_VALUE),
265
- border: _color(context, tokens?.border || DEFAULT_COLOR_TOKEN_VALUE),
266
- icon: _color(context, tokens?.icon || DEFAULT_COLOR_TOKEN_VALUE),
266
+ accent: {
267
+ fg: _color(context, tokens?.accent?.fg),
268
+ },
269
+ avatar: buildAvatarColorTheme({scheme}, tokens),
270
+ badge: buildBadgeColorTheme(tokens?.badge, {scheme}, config),
271
+ bg: _color(context, tokens?.bg),
272
+ border: _color(context, tokens?.border),
273
+ code: {
274
+ bg: _color(context, tokens?.code?.bg),
275
+ fg: _color(context, tokens?.code?.fg),
276
+ },
277
+ fg: _color(context, tokens?.fg),
278
+ icon: _color(context, tokens?.icon),
267
279
  muted: {
268
- fg: _color(context, tokens?.muted?.fg || DEFAULT_COLOR_TOKEN_VALUE),
280
+ bg: _color(context, tokens?.muted?.bg),
281
+ fg: _color(context, tokens?.muted?.fg),
269
282
  },
270
- accent: {
271
- fg: _color(context, tokens?.accent?.fg || DEFAULT_COLOR_TOKEN_VALUE),
283
+ kbd: {
284
+ bg: _color(context, tokens?.kbd?.bg),
285
+ fg: _color(context, tokens?.kbd?.fg),
286
+ border: _color(context, tokens?.kbd?.border),
272
287
  },
273
288
  link: {
274
- fg: _color(context, tokens?.link?.fg || DEFAULT_COLOR_TOKEN_VALUE),
275
- },
276
- code: {
277
- bg: _color(context, tokens?.code?.bg || DEFAULT_COLOR_TOKEN_VALUE),
278
- fg: _color(context, tokens?.code?.fg || DEFAULT_COLOR_TOKEN_VALUE),
289
+ fg: _color(context, tokens?.link?.fg),
279
290
  },
280
291
  skeleton: {
281
- from: _color(context, tokens?.skeleton?.from || DEFAULT_COLOR_TOKEN_VALUE),
282
- to: _color(context, tokens?.skeleton?.to || DEFAULT_COLOR_TOKEN_VALUE),
292
+ from: _color(context, tokens?.skeleton?.from),
293
+ to: _color(context, tokens?.skeleton?.to),
283
294
  },
284
295
  }
285
296
  }
286
297
 
287
- // function buildCardColorTheme(
288
- // options: {scheme: 'light' | 'dark'; baseTone: ColorBaseTone},
289
- // config?: ThemeConfig,
290
- // ): ThemeColorCard {
291
- // const {scheme, baseTone} = options
292
-
293
- // const states: Partial<ThemeColorCard> = {}
294
-
295
- // for (const state of COLOR_STATES) {
296
- // states[state] = buildCardStateColorTheme({scheme, state, baseTone}, config)
297
- // }
298
-
299
- // return states as ThemeColorCard
300
- // }
301
-
302
- // function buildCardStateColorTheme(
303
- // options: {scheme: 'light' | 'dark'; state: ColorState; baseTone: ColorBaseTone},
304
- // config?: ThemeConfig,
305
- // ): ThemeColorGenericState {
306
- // const {scheme, state, baseTone} = options
307
- // const tokens = config?.color?.card?.[state]
308
- // const hue = tokens?._hue || config?.color?.base?.[baseTone]?._hue || 'gray'
309
- // const blendMode = tokens?._blend || ['screen', 'multiply']
310
- // const context: ColorTokenContext = {hue, scheme}
311
-
312
- // return {
313
- // _blend: blendMode[scheme === 'light' ? 0 : 1],
314
- // bg: _color(context, tokens?.bg || ['50', '950']),
315
- // bg2: _color(context, tokens?.bg2 || ['50', '950']),
316
- // fg: _color(context, tokens?.fg || ['black', 'white']),
317
- // border: _color(context, tokens?.border || ['200', '800']),
318
- // icon: _color(context, tokens?.icon || ['500', '400']),
319
- // muted: {
320
- // fg: _color(context, tokens?.muted?.fg || ['600', '400']),
321
- // },
322
- // accent: {
323
- // fg: _color(context, tokens?.accent?.fg || ['600', '400']),
324
- // },
325
- // link: {
326
- // fg: _color(context, tokens?.link?.fg || ['600', '400']),
327
- // },
328
- // code: {
329
- // bg: _color(context, tokens?.code?.bg || ['600', '400']),
330
- // fg: _color(context, tokens?.code?.fg || ['600', '400']),
331
- // },
332
- // skeleton: {
333
- // from: _color(context, tokens?.skeleton?.from || ['100', '900']),
334
- // to: _color(context, tokens?.skeleton?.to || ['100/0.5', '900/0.5']),
335
- // },
336
- // }
337
- // }
338
-
339
298
  function buildInputColorTheme(
340
- options: {scheme: 'light' | 'dark'; tone: ThemeColorBaseToneKey},
299
+ options: {scheme: ThemeColorSchemeKey; tone: ThemeColorCardToneKey},
341
300
  config?: ThemeConfig,
342
- ): ThemeColorInput {
301
+ ): ThemeColorInput_v2 {
343
302
  const {scheme, tone} = options
344
303
 
345
304
  return {
@@ -351,11 +310,11 @@ function buildInputColorTheme(
351
310
  function buildInputStatesColorTheme(
352
311
  options: {
353
312
  mode: 'default' | 'invalid'
354
- scheme: 'light' | 'dark'
355
- tone: ThemeColorBaseToneKey
313
+ scheme: ThemeColorSchemeKey
314
+ tone: ThemeColorCardToneKey
356
315
  },
357
316
  config?: ThemeConfig,
358
- ): ThemeColorInputStates {
317
+ ): ThemeColorInputStates_v2 {
359
318
  const {mode, scheme, tone} = options
360
319
 
361
320
  return {
@@ -369,12 +328,12 @@ function buildInputStatesColorTheme(
369
328
  function buildInputStateColorTheme(
370
329
  options: {
371
330
  mode: 'default' | 'invalid'
372
- scheme: 'light' | 'dark'
331
+ scheme: ThemeColorSchemeKey
373
332
  state: 'enabled' | 'hovered' | 'readOnly' | 'disabled'
374
- tone: ThemeColorBaseToneKey
333
+ tone: ThemeColorCardToneKey
375
334
  },
376
335
  config?: ThemeConfig,
377
- ): ThemeColorInputState {
336
+ ): ThemeColorInputState_v2 {
378
337
  const {mode, tone, scheme, state} = options
379
338
  const tokens = config?.color?.input?.[mode]?.[state]
380
339
  const hue = tokens?._hue || config?.color?.base?.[tone]?._hue || 'gray'
@@ -383,57 +342,59 @@ function buildInputStateColorTheme(
383
342
 
384
343
  return {
385
344
  _blend: blendMode[scheme === 'light' ? 0 : 1],
386
- bg: _color(context, tokens?.bg || DEFAULT_COLOR_TOKEN_VALUE),
387
- bg2: _color(context, tokens?.bg2 || DEFAULT_COLOR_TOKEN_VALUE),
388
- fg: _color(context, tokens?.fg || DEFAULT_COLOR_TOKEN_VALUE),
389
- border: _color(context, tokens?.border || DEFAULT_COLOR_TOKEN_VALUE),
390
- placeholder: _color(context, tokens?.placeholder || DEFAULT_COLOR_TOKEN_VALUE),
345
+ bg: _color(context, tokens?.bg),
346
+ border: _color(context, tokens?.border),
347
+ fg: _color(context, tokens?.fg),
348
+ muted: {
349
+ bg: _color(context, tokens?.muted?.bg),
350
+ },
351
+ placeholder: _color(context, tokens?.placeholder),
391
352
  }
392
353
  }
393
354
 
394
355
  function buildSelectableColorTheme(
395
356
  options: {
396
- scheme: 'light' | 'dark'
357
+ scheme: ThemeColorSchemeKey
397
358
  },
398
359
  config?: ThemeConfig,
399
- ): ThemeColorButtonTones {
360
+ ): ThemeColorButtonTones_v2 {
400
361
  const {scheme} = options
401
362
 
402
- const tones: Partial<ThemeColorButtonTones> = {}
363
+ const tones: Partial<ThemeColorButtonTones_v2> = {}
403
364
 
404
365
  for (const tone of THEME_COLOR_STATE_TONES) {
405
366
  tones[tone] = buildSelectableStatesColorTheme({scheme, tone}, config)
406
367
  }
407
368
 
408
- return tones as ThemeColorButtonTones
369
+ return tones as ThemeColorButtonTones_v2
409
370
  }
410
371
 
411
372
  function buildSelectableStatesColorTheme(
412
373
  options: {
413
- scheme: 'light' | 'dark'
374
+ scheme: ThemeColorSchemeKey
414
375
  tone: ThemeColorStateToneKey
415
376
  },
416
377
  config?: ThemeConfig,
417
- ): ThemeColorButtonStates {
378
+ ): ThemeColorButtonStates_v2 {
418
379
  const {scheme, tone} = options
419
380
 
420
- const states: Partial<ThemeColorButtonStates> = {}
381
+ const states: Partial<ThemeColorButtonStates_v2> = {}
421
382
 
422
383
  for (const state of THEME_COLOR_STATES) {
423
384
  states[state] = buildSelectableStateColorTheme({tone, scheme, state}, config)
424
385
  }
425
386
 
426
- return states as ThemeColorButtonStates
387
+ return states as ThemeColorButtonStates_v2
427
388
  }
428
389
 
429
390
  function buildSelectableStateColorTheme(
430
391
  options: {
431
- scheme: 'light' | 'dark'
392
+ scheme: ThemeColorSchemeKey
432
393
  state: ThemeColorStateKey
433
394
  tone: ThemeColorStateToneKey
434
395
  },
435
396
  config?: ThemeConfig,
436
- ): ThemeColorGenericState {
397
+ ): ThemeColorState_v2 {
437
398
  const {scheme, state, tone} = options
438
399
  const tokens = config?.color?.selectable?.[tone]?.[state]
439
400
  const hue = tokens?._hue || 'gray'
@@ -442,54 +403,40 @@ function buildSelectableStateColorTheme(
442
403
 
443
404
  return {
444
405
  _blend: blendMode[scheme === 'light' ? 0 : 1],
445
- bg: _color(context, tokens?.bg || DEFAULT_COLOR_TOKEN_VALUE),
446
- bg2: _color(context, tokens?.bg2 || DEFAULT_COLOR_TOKEN_VALUE),
447
- fg: _color(context, tokens?.fg || DEFAULT_COLOR_TOKEN_VALUE),
448
- border: _color(context, tokens?.border || DEFAULT_COLOR_TOKEN_VALUE),
449
- icon: _color(context, tokens?.icon || DEFAULT_COLOR_TOKEN_VALUE),
406
+ accent: {
407
+ fg: _color(context, tokens?.accent?.fg),
408
+ },
409
+ avatar: buildAvatarColorTheme({scheme}, tokens),
410
+ badge: buildBadgeColorTheme(tokens?.badge, {scheme}, config),
411
+ bg: _color(context, tokens?.bg),
412
+ border: _color(context, tokens?.border),
413
+ code: {
414
+ bg: _color(context, tokens?.code?.bg),
415
+ fg: _color(context, tokens?.code?.fg),
416
+ },
417
+ fg: _color(context, tokens?.fg),
418
+ icon: _color(context, tokens?.icon),
450
419
  muted: {
451
- fg: _color(context, tokens?.muted?.fg || DEFAULT_COLOR_TOKEN_VALUE),
420
+ bg: _color(context, tokens?.muted?.bg),
421
+ fg: _color(context, tokens?.muted?.fg),
452
422
  },
453
- accent: {
454
- fg: _color(context, tokens?.accent?.fg || DEFAULT_COLOR_TOKEN_VALUE),
423
+ kbd: {
424
+ bg: _color(context, tokens?.kbd?.bg),
425
+ fg: _color(context, tokens?.kbd?.fg),
426
+ border: _color(context, tokens?.kbd?.border),
455
427
  },
456
428
  link: {
457
- fg: _color(context, tokens?.link?.fg || DEFAULT_COLOR_TOKEN_VALUE),
458
- },
459
- code: {
460
- bg: _color(context, tokens?.code?.bg || DEFAULT_COLOR_TOKEN_VALUE),
461
- fg: _color(context, tokens?.code?.fg || DEFAULT_COLOR_TOKEN_VALUE),
429
+ fg: _color(context, tokens?.link?.fg),
462
430
  },
463
431
  skeleton: {
464
- from: _color(context, tokens?.skeleton?.from || DEFAULT_COLOR_TOKEN_VALUE),
465
- to: _color(context, tokens?.skeleton?.to || DEFAULT_COLOR_TOKEN_VALUE),
432
+ from: _color(context, tokens?.skeleton?.from),
433
+ to: _color(context, tokens?.skeleton?.to),
466
434
  },
467
435
  }
468
436
  }
469
437
 
470
- function buildSpotColorTheme(
471
- options: {scheme: 'light' | 'dark'},
472
- config?: ThemeConfig,
473
- ): ThemeColorSpot {
474
- const {scheme} = options
475
- const tokens = config?.color?.avatar
476
- const context: ColorTokenContext = {hue: 'gray', scheme}
477
-
478
- return {
479
- gray: _color(context, tokens?.gray?.bg || DEFAULT_COLOR_TOKEN_VALUE),
480
- cyan: _color(context, tokens?.cyan?.bg || DEFAULT_COLOR_TOKEN_VALUE),
481
- blue: _color(context, tokens?.blue?.bg || DEFAULT_COLOR_TOKEN_VALUE),
482
- purple: _color(context, tokens?.purple?.bg || DEFAULT_COLOR_TOKEN_VALUE),
483
- magenta: _color(context, tokens?.magenta?.bg || DEFAULT_COLOR_TOKEN_VALUE),
484
- red: _color(context, tokens?.red?.bg || DEFAULT_COLOR_TOKEN_VALUE),
485
- orange: _color(context, tokens?.orange?.bg || DEFAULT_COLOR_TOKEN_VALUE),
486
- yellow: _color(context, tokens?.yellow?.bg || DEFAULT_COLOR_TOKEN_VALUE),
487
- green: _color(context, tokens?.green?.bg || DEFAULT_COLOR_TOKEN_VALUE),
488
- }
489
- }
490
-
491
438
  function buildSyntaxColorTheme(
492
- options: {scheme: 'light' | 'dark'},
439
+ options: {scheme: ThemeColorSchemeKey},
493
440
  config?: ThemeConfig,
494
441
  ): ThemeColorSyntax {
495
442
  const {scheme} = options
@@ -497,41 +444,41 @@ function buildSyntaxColorTheme(
497
444
  const context: ColorTokenContext = {hue: 'gray', scheme}
498
445
 
499
446
  return {
500
- atrule: _color(context, tokens?.atrule || DEFAULT_COLOR_TOKEN_VALUE),
501
- attrName: _color(context, tokens?.attrName || DEFAULT_COLOR_TOKEN_VALUE),
502
- attrValue: _color(context, tokens?.attrValue || DEFAULT_COLOR_TOKEN_VALUE),
503
- attribute: _color(context, tokens?.attribute || DEFAULT_COLOR_TOKEN_VALUE),
504
- boolean: _color(context, tokens?.boolean || DEFAULT_COLOR_TOKEN_VALUE),
505
- builtin: _color(context, tokens?.builtin || DEFAULT_COLOR_TOKEN_VALUE),
506
- cdata: _color(context, tokens?.cdata || DEFAULT_COLOR_TOKEN_VALUE),
507
- char: _color(context, tokens?.char || DEFAULT_COLOR_TOKEN_VALUE),
508
- class: _color(context, tokens?.class || DEFAULT_COLOR_TOKEN_VALUE),
509
- className: _color(context, tokens?.className || DEFAULT_COLOR_TOKEN_VALUE),
510
- comment: _color(context, tokens?.comment || DEFAULT_COLOR_TOKEN_VALUE),
511
- constant: _color(context, tokens?.constant || DEFAULT_COLOR_TOKEN_VALUE),
512
- deleted: _color(context, tokens?.deleted || DEFAULT_COLOR_TOKEN_VALUE),
513
- doctype: _color(context, tokens?.doctype || DEFAULT_COLOR_TOKEN_VALUE),
514
- entity: _color(context, tokens?.entity || DEFAULT_COLOR_TOKEN_VALUE),
515
- function: _color(context, tokens?.function || DEFAULT_COLOR_TOKEN_VALUE),
516
- hexcode: _color(context, tokens?.hexcode || DEFAULT_COLOR_TOKEN_VALUE),
517
- id: _color(context, tokens?.id || DEFAULT_COLOR_TOKEN_VALUE),
518
- important: _color(context, tokens?.important || DEFAULT_COLOR_TOKEN_VALUE),
519
- inserted: _color(context, tokens?.inserted || DEFAULT_COLOR_TOKEN_VALUE),
520
- keyword: _color(context, tokens?.keyword || DEFAULT_COLOR_TOKEN_VALUE),
521
- number: _color(context, tokens?.number || DEFAULT_COLOR_TOKEN_VALUE),
522
- operator: _color(context, tokens?.operator || DEFAULT_COLOR_TOKEN_VALUE),
523
- prolog: _color(context, tokens?.prolog || DEFAULT_COLOR_TOKEN_VALUE),
524
- property: _color(context, tokens?.property || DEFAULT_COLOR_TOKEN_VALUE),
525
- pseudoClass: _color(context, tokens?.pseudoClass || DEFAULT_COLOR_TOKEN_VALUE),
526
- pseudoElement: _color(context, tokens?.pseudoElement || DEFAULT_COLOR_TOKEN_VALUE),
527
- punctuation: _color(context, tokens?.punctuation || DEFAULT_COLOR_TOKEN_VALUE),
528
- regex: _color(context, tokens?.regex || DEFAULT_COLOR_TOKEN_VALUE),
529
- selector: _color(context, tokens?.selector || DEFAULT_COLOR_TOKEN_VALUE),
530
- string: _color(context, tokens?.string || DEFAULT_COLOR_TOKEN_VALUE),
531
- symbol: _color(context, tokens?.symbol || DEFAULT_COLOR_TOKEN_VALUE),
532
- tag: _color(context, tokens?.tag || DEFAULT_COLOR_TOKEN_VALUE),
533
- unit: _color(context, tokens?.unit || DEFAULT_COLOR_TOKEN_VALUE),
534
- url: _color(context, tokens?.url || DEFAULT_COLOR_TOKEN_VALUE),
535
- variable: _color(context, tokens?.variable || DEFAULT_COLOR_TOKEN_VALUE),
447
+ atrule: _color(context, tokens?.atrule),
448
+ attrName: _color(context, tokens?.attrName),
449
+ attrValue: _color(context, tokens?.attrValue),
450
+ attribute: _color(context, tokens?.attribute),
451
+ boolean: _color(context, tokens?.boolean),
452
+ builtin: _color(context, tokens?.builtin),
453
+ cdata: _color(context, tokens?.cdata),
454
+ char: _color(context, tokens?.char),
455
+ class: _color(context, tokens?.class),
456
+ className: _color(context, tokens?.className),
457
+ comment: _color(context, tokens?.comment),
458
+ constant: _color(context, tokens?.constant),
459
+ deleted: _color(context, tokens?.deleted),
460
+ doctype: _color(context, tokens?.doctype),
461
+ entity: _color(context, tokens?.entity),
462
+ function: _color(context, tokens?.function),
463
+ hexcode: _color(context, tokens?.hexcode),
464
+ id: _color(context, tokens?.id),
465
+ important: _color(context, tokens?.important),
466
+ inserted: _color(context, tokens?.inserted),
467
+ keyword: _color(context, tokens?.keyword),
468
+ number: _color(context, tokens?.number),
469
+ operator: _color(context, tokens?.operator),
470
+ prolog: _color(context, tokens?.prolog),
471
+ property: _color(context, tokens?.property),
472
+ pseudoClass: _color(context, tokens?.pseudoClass),
473
+ pseudoElement: _color(context, tokens?.pseudoElement),
474
+ punctuation: _color(context, tokens?.punctuation),
475
+ regex: _color(context, tokens?.regex),
476
+ selector: _color(context, tokens?.selector),
477
+ string: _color(context, tokens?.string),
478
+ symbol: _color(context, tokens?.symbol),
479
+ tag: _color(context, tokens?.tag),
480
+ unit: _color(context, tokens?.unit),
481
+ url: _color(context, tokens?.url),
482
+ variable: _color(context, tokens?.variable),
536
483
  }
537
484
  }