@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.
- package/dist/index.cjs.mjs +4 -3
- package/dist/index.d.ts +29 -22
- package/dist/index.esm.js +397 -518
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +413 -534
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs.mjs +10 -4
- package/dist/theme.d.ts +489 -201
- package/dist/theme.esm.js +2934 -2748
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +2943 -2751
- package/dist/theme.js.map +1 -1
- package/package.json +3 -3
- package/src/core/_compat.ts +7 -7
- package/src/core/components/dialog/dialog.tsx +5 -5
- package/src/core/components/dialog/styles.ts +4 -5
- package/src/core/components/hotkeys/hotkeys.tsx +4 -2
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +50 -0
- package/src/core/components/menu/__workshop__/index.ts +5 -0
- package/src/core/components/menu/menuItem.tsx +7 -1
- package/src/core/components/skeleton/textSkeleton.tsx +12 -14
- package/src/core/components/tree/style.ts +14 -17
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +3 -3
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +2 -3
- package/src/core/primitives/_selectable/style.ts +18 -18
- package/src/core/primitives/avatar/avatar.tsx +3 -3
- package/src/core/primitives/avatar/avatarCounter.tsx +4 -4
- package/src/core/primitives/avatar/avatarStack.tsx +2 -2
- package/src/core/primitives/avatar/styles.ts +7 -8
- package/src/core/primitives/avatar/types.ts +2 -2
- package/src/core/primitives/badge/__workshop__/props.tsx +1 -1
- package/src/core/primitives/badge/__workshop__/tones.tsx +1 -1
- package/src/core/primitives/badge/badge.tsx +1 -1
- package/src/core/primitives/badge/styles.ts +5 -6
- package/src/core/primitives/button/button.tsx +3 -4
- package/src/core/primitives/button/styles.ts +22 -23
- package/src/core/primitives/card/__workshop__/selected.tsx +15 -15
- package/src/core/primitives/card/card.tsx +1 -1
- package/src/core/primitives/card/styles.ts +22 -22
- package/src/core/primitives/checkbox/styles.ts +21 -22
- package/src/core/primitives/code/styles.ts +4 -1
- package/src/core/primitives/container/styles.ts +2 -3
- package/src/core/primitives/heading/styles.ts +4 -2
- package/src/core/primitives/inline/styles.ts +6 -6
- package/src/core/primitives/kbd/kbd.tsx +7 -11
- package/src/core/primitives/label/styles.ts +4 -3
- package/src/core/primitives/popover/helpers.ts +3 -4
- package/src/core/primitives/popover/popover.tsx +8 -4
- package/src/core/primitives/popover/types.ts +1 -1
- package/src/core/primitives/radio/styles.ts +17 -19
- package/src/core/primitives/select/styles.ts +27 -32
- package/src/core/primitives/stack/styles.ts +2 -3
- package/src/core/primitives/switch/__workshop__/props.tsx +11 -31
- package/src/core/primitives/switch/styles.ts +18 -21
- package/src/core/primitives/text/__workshop__/colored.tsx +10 -10
- package/src/core/primitives/text/styles.ts +9 -4
- package/src/core/primitives/tooltip/tooltip.tsx +3 -3
- package/src/core/styles/border/borderStyle.ts +6 -11
- package/src/core/styles/box/boxStyle.ts +5 -9
- package/src/core/styles/card/_cardColorStyle.ts +99 -0
- package/src/core/styles/card/index.ts +1 -0
- package/src/core/styles/flex/flexItemStyle.ts +2 -3
- package/src/core/styles/flex/flexStyle.ts +6 -11
- package/src/core/styles/font/responsiveFont.ts +4 -4
- package/src/core/styles/font/textAlignStyle.ts +3 -3
- package/src/core/styles/grid/gridItemStyle.ts +7 -13
- package/src/core/styles/grid/gridStyle.ts +9 -17
- package/src/core/styles/helpers.ts +5 -3
- package/src/core/styles/input/responsiveInputPaddingStyle.ts +6 -6
- package/src/core/styles/input/textInputStyle.ts +36 -40
- package/src/core/styles/margin/marginsStyle.test.ts +2 -3
- package/src/core/styles/padding/paddingStyle.test.ts +2 -3
- package/src/core/styles/radius/radiusStyle.ts +2 -3
- package/src/core/styles/shadow/shadowStyle.ts +4 -5
- package/src/core/theme/__workshop__/build/Root.tsx +24 -20
- package/src/core/theme/__workshop__/build/story.tsx +22 -26
- package/src/core/theme/__workshop__/canvas.tsx +21 -40
- package/src/core/theme/theme.test.tsx +2 -35
- package/src/core/theme/themeColorProvider.tsx +2 -2
- package/src/core/theme/themeContext.ts +2 -2
- package/src/core/theme/themeProvider.tsx +25 -25
- package/src/core/theme/types.ts +3 -2
- package/src/core/theme/useRootTheme.ts +1 -9
- package/src/core/theme/useTheme.ts +8 -1
- package/src/core/types/card.ts +2 -2
- package/src/core/utils/arrow/arrow.tsx +3 -3
- package/src/core/utils/elementQuery/elementQuery.tsx +3 -3
- package/src/core/utils/virtualList/virtualList.tsx +2 -2
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +2 -2
- package/src/theme/build/buildColorTheme.test.ts +14 -15
- package/src/theme/build/buildColorTheme.ts +239 -292
- package/src/theme/build/buildTheme.test.ts +9 -7
- package/src/theme/build/buildTheme.ts +12 -9
- package/src/theme/build/colorToken.ts +3 -1
- package/src/theme/build/lib/color-fns/contrastRatio.ts +1 -0
- package/src/theme/build/lib/isRecord.ts +3 -0
- package/src/theme/build/merge.ts +18 -13
- package/src/theme/build/renderColorTheme.ts +205 -213
- package/src/theme/build/renderColorValue.ts +15 -8
- package/src/theme/build/resolveColorTokens.ts +177 -198
- package/src/theme/build/theme.test.ts +27 -0
- package/src/theme/config/helpers.ts +16 -8
- package/src/theme/config/system.ts +46 -17
- package/src/theme/config/tokens/color/types.ts +55 -32
- package/src/theme/config/tokens/types.ts +11 -4
- package/src/theme/config/types.ts +5 -11
- package/src/theme/{build/defaults → defaults}/colorPalette.ts +1 -1
- package/src/theme/{build/defaults → defaults}/colorTokens.ts +189 -136
- package/src/theme/{build/defaults → defaults}/config.ts +14 -12
- package/src/theme/{build/defaults → defaults}/fonts.ts +6 -6
- package/src/theme/getScopedTheme.ts +81 -0
- package/src/theme/index.ts +9 -1
- package/src/theme/system/avatar.ts +1 -1
- package/src/theme/system/color/_constants.ts +11 -11
- package/src/theme/system/color/_system.ts +10 -71
- package/src/theme/system/color/avatar.ts +22 -10
- package/src/theme/system/color/badge.ts +18 -7
- package/src/theme/system/color/button.ts +17 -23
- package/src/theme/system/color/color.ts +34 -0
- package/src/theme/system/color/index.ts +3 -10
- package/src/theme/system/color/input.ts +13 -11
- package/src/theme/system/color/kbd.ts +3 -3
- package/src/theme/system/color/selectable.ts +13 -19
- package/src/theme/system/color/shadow.ts +7 -0
- package/src/theme/system/color/state.ts +37 -0
- package/src/theme/system/css.ts +9 -0
- package/src/theme/system/focusRing.ts +7 -0
- package/src/theme/system/index.ts +5 -1
- package/src/theme/system/input.ts +1 -1
- package/src/theme/system/layer.ts +1 -2
- package/src/theme/system/shadow.ts +1 -0
- package/src/theme/system/styles.ts +19 -0
- package/src/theme/system/theme.ts +128 -0
- package/src/theme/system/{color → v0/color}/_generic.ts +2 -1
- package/src/theme/system/v0/color/_system.ts +13 -0
- package/src/theme/system/{color → v0/color}/base.ts +2 -0
- package/src/theme/system/v0/color/button.ts +42 -0
- package/src/theme/system/{color → v0/color}/card.ts +2 -1
- package/src/theme/system/v0/color/color.ts +40 -0
- package/src/theme/system/v0/color/index.ts +11 -0
- package/src/theme/system/v0/color/input.ts +34 -0
- package/src/theme/system/{color/_deprecated → v0/color}/muted.ts +1 -1
- package/src/theme/system/v0/color/selectable.ts +31 -0
- package/src/theme/system/{color/_deprecated → v0/color}/solid.ts +1 -1
- package/src/theme/system/v0/color/spot.ts +13 -0
- package/src/theme/system/v0/index.ts +1 -0
- package/src/theme/versioning/getTheme_v2.ts +38 -0
- package/src/theme/versioning/index.ts +5 -0
- package/src/theme/versioning/is_v0.ts +6 -0
- package/src/theme/versioning/is_v2.ts +6 -0
- package/src/theme/versioning/themeColor_v0_v2.ts +217 -0
- package/src/theme/versioning/v0_v2.ts +72 -0
- package/src/theme/versioning/v2_v0.ts +126 -0
- package/src/core/styles/colorVars/colorVarsStyle.ts +0 -43
- package/src/core/styles/colorVars/index.ts +0 -1
- package/src/core/theme/defaults.ts +0 -7
- package/src/theme/system/_system.ts +0 -95
- package/src/theme/system/color/_deprecated/spot.ts +0 -13
- package/src/theme/themes/studio/config.ts +0 -69
- package/src/theme/themes/studio/fonts.ts +0 -219
- package/src/theme/themes/studio/index.ts +0 -1
- package/src/theme/themes/studio/studioTheme.test.ts +0 -27
- package/src/theme/themes/studio/studioTheme.ts +0 -8
|
@@ -1,256 +1,260 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
7
|
+
ThemeColorCardToneKey,
|
|
8
8
|
ThemeColorButtonModeKey,
|
|
9
9
|
ThemeColorStateKey,
|
|
10
10
|
ThemeColorStateToneKey,
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
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'},
|
|
35
|
-
dark: buildColorScheme({scheme: 'dark'},
|
|
38
|
+
light: buildColorScheme({scheme: 'light'}, resolvedConfig),
|
|
39
|
+
dark: buildColorScheme({scheme: 'dark'}, resolvedConfig),
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
options: {scheme:
|
|
41
|
-
config
|
|
42
|
-
):
|
|
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:
|
|
52
|
-
default:
|
|
53
|
-
primary:
|
|
54
|
-
positive:
|
|
55
|
-
caution:
|
|
56
|
-
critical:
|
|
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
|
-
|
|
61
|
-
options: {scheme:
|
|
59
|
+
function buildCardColorTheme(
|
|
60
|
+
options: {scheme: ThemeColorSchemeKey; tone: ThemeColorCardToneKey},
|
|
62
61
|
config?: ThemeConfig,
|
|
63
|
-
):
|
|
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
|
|
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
|
-
|
|
83
|
-
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
111
|
-
|
|
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
|
-
|
|
118
|
-
|
|
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
|
-
|
|
107
|
+
syntax: buildSyntaxColorTheme({scheme}, config),
|
|
108
|
+
}
|
|
109
|
+
}
|
|
121
110
|
|
|
122
|
-
|
|
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:
|
|
128
|
-
|
|
129
|
-
):
|
|
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},
|
|
134
|
-
blue: _buildAvatarColorTheme({color: 'blue', scheme},
|
|
135
|
-
purple: _buildAvatarColorTheme({color: 'purple', scheme},
|
|
136
|
-
magenta: _buildAvatarColorTheme({color: 'magenta', scheme},
|
|
137
|
-
red: _buildAvatarColorTheme({color: 'red', scheme},
|
|
138
|
-
orange: _buildAvatarColorTheme({color: 'orange', scheme},
|
|
139
|
-
yellow: _buildAvatarColorTheme({color: 'yellow', scheme},
|
|
140
|
-
green: _buildAvatarColorTheme({color: 'green', scheme},
|
|
141
|
-
cyan: _buildAvatarColorTheme({color: 'cyan', scheme},
|
|
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:
|
|
147
|
-
|
|
148
|
-
):
|
|
148
|
+
options: {color: ThemeColorAvatarColorKey; scheme: ThemeColorSchemeKey},
|
|
149
|
+
stateTokens?: ThemeColorStateTokens,
|
|
150
|
+
): ThemeColorAvatarHue_v2 {
|
|
149
151
|
const {color, scheme} = options
|
|
150
|
-
const tokens =
|
|
152
|
+
const tokens = stateTokens?.avatar?.[color]
|
|
151
153
|
const context: ColorTokenContext = {hue: tokens?._hue || 'gray', scheme}
|
|
152
|
-
const blendMode = tokens?._blend || ['
|
|
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
|
|
157
|
-
fg: _color(context, tokens?.fg
|
|
158
|
+
bg: _color(context, tokens?.bg),
|
|
159
|
+
fg: _color(context, tokens?.fg),
|
|
158
160
|
}
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
function buildBadgeColorTheme(
|
|
162
|
-
|
|
164
|
+
tokens: ThemeColorBadgeTokens | undefined,
|
|
165
|
+
options: {scheme: ThemeColorSchemeKey},
|
|
163
166
|
config?: ThemeConfig,
|
|
164
|
-
):
|
|
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
|
-
|
|
180
|
+
parentTokens: ThemeColorBadgeTokens | undefined,
|
|
181
|
+
options: {scheme: ThemeColorSchemeKey; tone: ThemeColorStateToneKey},
|
|
178
182
|
config?: ThemeConfig,
|
|
179
|
-
):
|
|
183
|
+
): ThemeColorBadge_v2['default'] {
|
|
180
184
|
const {scheme, tone} = options
|
|
181
|
-
const tokens =
|
|
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
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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:
|
|
198
|
+
options: {scheme: ThemeColorSchemeKey},
|
|
195
199
|
config?: ThemeConfig,
|
|
196
|
-
):
|
|
200
|
+
): ThemeColorButton_v2 {
|
|
197
201
|
const {scheme} = options
|
|
198
202
|
|
|
199
|
-
const modes: Partial<
|
|
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
|
|
209
|
+
return modes as ThemeColorButton_v2
|
|
206
210
|
}
|
|
207
211
|
|
|
208
212
|
function buildButtonTonesColorTheme(
|
|
209
213
|
options: {
|
|
210
|
-
scheme:
|
|
214
|
+
scheme: ThemeColorSchemeKey
|
|
211
215
|
mode: ThemeColorButtonModeKey
|
|
212
216
|
},
|
|
213
217
|
config?: ThemeConfig,
|
|
214
|
-
):
|
|
218
|
+
): ThemeColorButtonTones_v2 {
|
|
215
219
|
const {mode, scheme} = options
|
|
216
220
|
|
|
217
|
-
const tones: Partial<
|
|
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
|
|
227
|
+
return tones as ThemeColorButtonTones_v2
|
|
224
228
|
}
|
|
225
229
|
|
|
226
230
|
function buildButtonStatesColorTheme(
|
|
227
231
|
options: {
|
|
228
232
|
mode: ThemeColorButtonModeKey
|
|
229
|
-
scheme:
|
|
233
|
+
scheme: ThemeColorSchemeKey
|
|
230
234
|
tone: ThemeColorStateToneKey
|
|
231
235
|
},
|
|
232
236
|
config?: ThemeConfig,
|
|
233
|
-
):
|
|
237
|
+
): ThemeColorButtonStates_v2 {
|
|
234
238
|
const {mode, scheme, tone} = options
|
|
235
239
|
|
|
236
|
-
const states: Partial<
|
|
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
|
|
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:
|
|
253
|
+
scheme: ThemeColorSchemeKey
|
|
250
254
|
state: ThemeColorStateKey
|
|
251
255
|
},
|
|
252
256
|
config?: ThemeConfig,
|
|
253
|
-
):
|
|
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
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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
|
-
|
|
280
|
+
bg: _color(context, tokens?.muted?.bg),
|
|
281
|
+
fg: _color(context, tokens?.muted?.fg),
|
|
269
282
|
},
|
|
270
|
-
|
|
271
|
-
|
|
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
|
|
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
|
|
282
|
-
to: _color(context, tokens?.skeleton?.to
|
|
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:
|
|
299
|
+
options: {scheme: ThemeColorSchemeKey; tone: ThemeColorCardToneKey},
|
|
341
300
|
config?: ThemeConfig,
|
|
342
|
-
):
|
|
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:
|
|
355
|
-
tone:
|
|
313
|
+
scheme: ThemeColorSchemeKey
|
|
314
|
+
tone: ThemeColorCardToneKey
|
|
356
315
|
},
|
|
357
316
|
config?: ThemeConfig,
|
|
358
|
-
):
|
|
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:
|
|
331
|
+
scheme: ThemeColorSchemeKey
|
|
373
332
|
state: 'enabled' | 'hovered' | 'readOnly' | 'disabled'
|
|
374
|
-
tone:
|
|
333
|
+
tone: ThemeColorCardToneKey
|
|
375
334
|
},
|
|
376
335
|
config?: ThemeConfig,
|
|
377
|
-
):
|
|
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
|
|
387
|
-
|
|
388
|
-
fg: _color(context, tokens?.fg
|
|
389
|
-
|
|
390
|
-
|
|
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:
|
|
357
|
+
scheme: ThemeColorSchemeKey
|
|
397
358
|
},
|
|
398
359
|
config?: ThemeConfig,
|
|
399
|
-
):
|
|
360
|
+
): ThemeColorButtonTones_v2 {
|
|
400
361
|
const {scheme} = options
|
|
401
362
|
|
|
402
|
-
const tones: Partial<
|
|
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
|
|
369
|
+
return tones as ThemeColorButtonTones_v2
|
|
409
370
|
}
|
|
410
371
|
|
|
411
372
|
function buildSelectableStatesColorTheme(
|
|
412
373
|
options: {
|
|
413
|
-
scheme:
|
|
374
|
+
scheme: ThemeColorSchemeKey
|
|
414
375
|
tone: ThemeColorStateToneKey
|
|
415
376
|
},
|
|
416
377
|
config?: ThemeConfig,
|
|
417
|
-
):
|
|
378
|
+
): ThemeColorButtonStates_v2 {
|
|
418
379
|
const {scheme, tone} = options
|
|
419
380
|
|
|
420
|
-
const states: Partial<
|
|
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
|
|
387
|
+
return states as ThemeColorButtonStates_v2
|
|
427
388
|
}
|
|
428
389
|
|
|
429
390
|
function buildSelectableStateColorTheme(
|
|
430
391
|
options: {
|
|
431
|
-
scheme:
|
|
392
|
+
scheme: ThemeColorSchemeKey
|
|
432
393
|
state: ThemeColorStateKey
|
|
433
394
|
tone: ThemeColorStateToneKey
|
|
434
395
|
},
|
|
435
396
|
config?: ThemeConfig,
|
|
436
|
-
):
|
|
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
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
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
|
-
|
|
420
|
+
bg: _color(context, tokens?.muted?.bg),
|
|
421
|
+
fg: _color(context, tokens?.muted?.fg),
|
|
452
422
|
},
|
|
453
|
-
|
|
454
|
-
|
|
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
|
|
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
|
|
465
|
-
to: _color(context, tokens?.skeleton?.to
|
|
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:
|
|
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
|
|
501
|
-
attrName: _color(context, tokens?.attrName
|
|
502
|
-
attrValue: _color(context, tokens?.attrValue
|
|
503
|
-
attribute: _color(context, tokens?.attribute
|
|
504
|
-
boolean: _color(context, tokens?.boolean
|
|
505
|
-
builtin: _color(context, tokens?.builtin
|
|
506
|
-
cdata: _color(context, tokens?.cdata
|
|
507
|
-
char: _color(context, tokens?.char
|
|
508
|
-
class: _color(context, tokens?.class
|
|
509
|
-
className: _color(context, tokens?.className
|
|
510
|
-
comment: _color(context, tokens?.comment
|
|
511
|
-
constant: _color(context, tokens?.constant
|
|
512
|
-
deleted: _color(context, tokens?.deleted
|
|
513
|
-
doctype: _color(context, tokens?.doctype
|
|
514
|
-
entity: _color(context, tokens?.entity
|
|
515
|
-
function: _color(context, tokens?.function
|
|
516
|
-
hexcode: _color(context, tokens?.hexcode
|
|
517
|
-
id: _color(context, tokens?.id
|
|
518
|
-
important: _color(context, tokens?.important
|
|
519
|
-
inserted: _color(context, tokens?.inserted
|
|
520
|
-
keyword: _color(context, tokens?.keyword
|
|
521
|
-
number: _color(context, tokens?.number
|
|
522
|
-
operator: _color(context, tokens?.operator
|
|
523
|
-
prolog: _color(context, tokens?.prolog
|
|
524
|
-
property: _color(context, tokens?.property
|
|
525
|
-
pseudoClass: _color(context, tokens?.pseudoClass
|
|
526
|
-
pseudoElement: _color(context, tokens?.pseudoElement
|
|
527
|
-
punctuation: _color(context, tokens?.punctuation
|
|
528
|
-
regex: _color(context, tokens?.regex
|
|
529
|
-
selector: _color(context, tokens?.selector
|
|
530
|
-
string: _color(context, tokens?.string
|
|
531
|
-
symbol: _color(context, tokens?.symbol
|
|
532
|
-
tag: _color(context, tokens?.tag
|
|
533
|
-
unit: _color(context, tokens?.unit
|
|
534
|
-
url: _color(context, tokens?.url
|
|
535
|
-
variable: _color(context, tokens?.variable
|
|
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
|
}
|