@sanity/ui 2.9.0-corel.0 → 3.0.0-static.0
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/bin/ui.js +6 -0
- package/dist/_chunks-cjs/buildCommand.js +2836 -0
- package/dist/_chunks-cjs/buildCommand.js.map +1 -0
- package/dist/_chunks-cjs/getTheme_v2.js +1 -27
- package/dist/_chunks-cjs/getTheme_v2.js.map +1 -1
- package/dist/_chunks-es/getTheme_v2.mjs +1 -27
- package/dist/_chunks-es/getTheme_v2.mjs.map +1 -1
- package/dist/_legacy/getTheme_v2.esm.js +1 -27
- package/dist/_legacy/getTheme_v2.esm.js.map +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +23 -0
- package/dist/cli.js.map +1 -0
- package/dist/css.d.mts +943 -0
- package/dist/css.d.ts +943 -0
- package/dist/css.esm.js +3135 -0
- package/dist/css.esm.js.map +1 -0
- package/dist/css.js +3135 -0
- package/dist/css.js.map +1 -0
- package/dist/css.mjs +3135 -0
- package/dist/css.mjs.map +1 -0
- package/dist/index.d.mts +175 -164
- package/dist/index.d.ts +175 -164
- package/dist/index.esm.js +864 -1955
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +870 -1962
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +864 -1955
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-theme.css +25 -0
- package/dist/system.css +2953 -0
- package/dist/theme.d.mts +84 -22
- package/dist/theme.d.ts +84 -22
- package/dist/theme.esm.js +232 -283
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +232 -283
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +232 -283
- package/dist/theme.mjs.map +1 -1
- package/exports/css.ts +1 -0
- package/package.json +25 -4
- package/src/core/__workshop__/constants.ts +15 -15
- package/src/core/__workshop__/fontsPlugin.tsx +1 -1
- package/src/core/components/autocomplete/autocomplete.styles.tsx +1 -1
- package/src/core/components/autocomplete/autocomplete.tsx +12 -4
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +1 -3
- package/src/core/components/breadcrumbs/__workshop__/index.ts +0 -5
- package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +14 -2
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +14 -9
- package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
- package/src/core/components/dialog/dialog.tsx +77 -92
- package/src/core/components/hotkeys/hotkeys.tsx +18 -29
- package/src/core/components/menu/menu.tsx +8 -5
- package/src/core/components/menu/menuDivider.ts +2 -1
- package/src/core/components/menu/menuGroup.tsx +16 -8
- package/src/core/components/menu/menuItem.tsx +23 -14
- package/src/core/components/skeleton/skeleton.tsx +1 -1
- package/src/core/components/skeleton/styles.ts +1 -1
- package/src/core/components/skeleton/textSkeleton.tsx +1 -1
- package/src/core/components/tab/tab.tsx +6 -7
- package/src/core/components/tab/tabList.tsx +3 -2
- package/src/core/components/toast/styles.ts +1 -1
- package/src/core/components/toast/toast.tsx +6 -4
- package/src/core/components/toast/toastProvider.tsx +31 -22
- package/src/core/components/tree/style.ts +1 -1
- package/src/core/components/tree/tree.tsx +8 -2
- package/src/core/components/tree/treeGroup.tsx +1 -1
- package/src/core/components/tree/treeItem.tsx +38 -25
- package/src/core/components/tree/types.ts +5 -1
- package/src/core/lib/styled/elements.ts +135 -0
- package/src/core/lib/styled/index.ts +2 -0
- package/src/core/lib/styled/members.ts +15 -0
- package/src/core/lib/styled/styled.ts +79 -0
- package/src/core/primitives/_selectable/selectable.tsx +27 -14
- package/src/core/primitives/avatar/avatar.tsx +52 -32
- package/src/core/primitives/avatar/avatarCounter.tsx +1 -1
- package/src/core/primitives/avatar/avatarStack.tsx +1 -1
- package/src/core/primitives/badge/__workshop__/tones.tsx +9 -16
- package/src/core/primitives/badge/badge.tsx +18 -20
- package/src/core/primitives/box/box.tsx +62 -74
- package/src/core/primitives/button/__workshop__/props.tsx +3 -1
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled1.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled2.tsx +1 -1
- package/src/core/primitives/button/button.tsx +38 -45
- package/src/core/primitives/button/styles.ts +2 -2
- package/src/core/primitives/card/RootCardContext.ts +3 -0
- package/src/core/primitives/card/__workshop__/selected.tsx +1 -1
- package/src/core/primitives/card/__workshop__/styled.tsx +1 -1
- package/src/core/primitives/card/card.tsx +44 -46
- package/src/core/primitives/card/styles.ts +1 -1
- package/src/core/primitives/checkbox/checkbox.tsx +6 -8
- package/src/core/primitives/code/code.tsx +23 -12
- package/src/core/primitives/code/styles.ts +1 -1
- package/src/core/primitives/container/container.tsx +7 -15
- package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
- package/src/core/primitives/flex/flex.tsx +6 -19
- package/src/core/primitives/grid/grid.tsx +2 -1
- package/src/core/primitives/heading/heading.tsx +32 -19
- package/src/core/primitives/heading/styles.ts +1 -1
- package/src/core/primitives/inline/inline.tsx +22 -13
- package/src/core/primitives/kbd/kbd.tsx +30 -37
- package/src/core/primitives/label/label.tsx +15 -4
- package/src/core/primitives/label/styles.ts +1 -1
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -1
- package/src/core/primitives/popover/popover.tsx +21 -15
- package/src/core/primitives/popover/popoverCard.tsx +36 -38
- package/src/core/primitives/radio/radio.tsx +1 -1
- package/src/core/primitives/radio/styles.ts +1 -1
- package/src/core/primitives/select/select.tsx +1 -1
- package/src/core/primitives/select/styles.ts +1 -1
- package/src/core/primitives/spinner/spinner.tsx +6 -20
- package/src/core/primitives/stack/stack.tsx +12 -10
- package/src/core/primitives/switch/styles.ts +9 -9
- package/src/core/primitives/switch/switch.tsx +20 -21
- package/src/core/primitives/text/__workshop__/colored.tsx +1 -1
- package/src/core/primitives/text/styles.ts +1 -2
- package/src/core/primitives/text/text.tsx +17 -21
- package/src/core/primitives/textArea/textArea.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/textInput/textInput.tsx +176 -123
- package/src/core/primitives/tooltip/tooltip.test.tsx +1 -0
- package/src/core/primitives/tooltip/tooltip.tsx +13 -13
- package/src/core/primitives/tooltip/tooltipCard.tsx +15 -14
- package/src/core/primitives/types.ts +35 -16
- package/src/core/styles/border/borderStyle.ts +6 -0
- package/src/core/styles/border/types.ts +1 -0
- package/src/core/styles/box/boxStyle.ts +6 -0
- package/src/core/styles/card/_cardColorStyle.ts +0 -8
- package/src/core/styles/flex/flexStyle.ts +0 -18
- package/src/core/styles/flex/types.ts +1 -3
- package/src/core/styles/grid/gridStyle.ts +0 -10
- package/src/core/styles/helpers.ts +9 -0
- package/src/core/styles/input/textInputStyle.ts +1 -1
- package/src/core/theme/__workshop__/build/Root.tsx +1 -1
- package/src/core/theme/themeProvider.tsx +1 -1
- package/src/core/theme/useTheme.ts +1 -1
- package/src/core/types/avatar.ts +6 -1
- package/src/core/types/button.ts +1 -0
- package/src/core/types/flex.ts +27 -26
- package/src/core/types/gridItem.ts +32 -24
- package/src/core/types/radius.ts +7 -4
- package/src/core/utils/arrow/arrow.tsx +1 -1
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +1 -1
- package/src/core/utils/layer/layer.tsx +28 -11
- package/src/core/utils/srOnly/srOnly.tsx +1 -1
- package/src/core/utils/virtualList/virtualList.tsx +1 -1
- package/src/css/_resp.ts +28 -0
- package/src/css/cli/buildCommand.ts +36 -0
- package/src/css/cli/index.ts +38 -0
- package/src/css/compile/comileRules.ts +59 -0
- package/src/css/compile/compileRule.ts +58 -0
- package/src/css/compile/compileSystem.ts +7 -0
- package/src/css/compile/compileTheme.ts +509 -0
- package/src/css/components/breadcrumbs/breadcrumbs.ts +5 -0
- package/src/css/components/breadcrumbs/index.ts +1 -0
- package/src/css/components/breadcrumbs/rules.ts +7 -0
- package/src/css/components/dialog/classes.ts +29 -0
- package/src/css/components/dialog/index.ts +1 -0
- package/src/css/components/dialog/rules.ts +75 -0
- package/src/css/components/tree/index.ts +1 -0
- package/src/css/components/tree/rules.ts +52 -0
- package/src/css/components/tree/tree.ts +5 -0
- package/src/css/composeClassNames.ts +3 -0
- package/src/css/index.ts +47 -0
- package/src/css/primitives/avatar/avatar.ts +32 -0
- package/src/css/primitives/avatar/index.ts +2 -0
- package/src/css/primitives/avatar/rules.ts +190 -0
- package/src/css/primitives/avatar/types.ts +9 -0
- package/src/css/primitives/badge/badge.ts +8 -0
- package/src/css/primitives/badge/index.ts +2 -0
- package/src/css/primitives/badge/rules.ts +25 -0
- package/src/css/primitives/badge/types.ts +8 -0
- package/src/css/primitives/box/box.ts +34 -0
- package/src/css/primitives/box/index.ts +2 -0
- package/src/css/primitives/box/rules.ts +25 -0
- package/src/css/primitives/box/types.ts +49 -0
- package/src/css/primitives/button/button.ts +26 -0
- package/src/css/primitives/button/index.ts +1 -0
- package/src/css/primitives/button/rules.ts +58 -0
- package/src/css/primitives/card/card.ts +21 -0
- package/src/css/primitives/card/index.ts +1 -0
- package/src/css/primitives/card/rules.ts +93 -0
- package/src/{core/primitives/checkbox/styles.ts → css/primitives/checkbox/__styles.ts} +3 -3
- package/src/css/primitives/checkbox/checkbox.ts +9 -0
- package/src/css/primitives/checkbox/index.ts +1 -0
- package/src/css/primitives/checkbox/rules.ts +136 -0
- package/src/css/primitives/code/code.ts +9 -0
- package/src/css/primitives/code/index.ts +2 -0
- package/src/css/primitives/code/rules.ts +71 -0
- package/src/css/primitives/code/types.ts +10 -0
- package/src/css/primitives/container/container.ts +7 -0
- package/src/css/primitives/container/index.ts +2 -0
- package/src/css/primitives/container/rules.ts +8 -0
- package/src/css/primitives/container/types.ts +6 -0
- package/src/css/primitives/heading/heading.ts +16 -0
- package/src/css/primitives/heading/index.ts +2 -0
- package/src/css/primitives/heading/rules.ts +84 -0
- package/src/css/primitives/heading/types.ts +12 -0
- package/src/css/primitives/kbd/index.ts +2 -0
- package/src/css/primitives/kbd/kbd.ts +7 -0
- package/src/css/primitives/kbd/rules.ts +20 -0
- package/src/css/primitives/kbd/types.ts +5 -0
- package/src/css/primitives/label/index.ts +2 -0
- package/src/css/primitives/label/label.ts +16 -0
- package/src/css/primitives/label/rules.ts +85 -0
- package/src/css/primitives/label/types.ts +12 -0
- package/src/css/primitives/popover/index.ts +1 -0
- package/src/css/primitives/popover/popover.ts +5 -0
- package/src/css/primitives/popover/rules.ts +5 -0
- package/src/css/primitives/radio/index.ts +1 -0
- package/src/css/primitives/radio/radio.ts +5 -0
- package/src/css/primitives/radio/rules.ts +5 -0
- package/src/css/primitives/select/index.ts +1 -0
- package/src/css/primitives/select/rules.ts +5 -0
- package/src/css/primitives/select/select.ts +5 -0
- package/src/{core/primitives/_selectable/style.ts → css/primitives/selectable/__style.ts} +5 -4
- package/src/css/primitives/selectable/index.ts +2 -0
- package/src/css/primitives/selectable/rules.ts +27 -0
- package/src/css/primitives/selectable/selectable.ts +9 -0
- package/src/css/primitives/selectable/types.ts +6 -0
- package/src/css/primitives/spinner/index.ts +1 -0
- package/src/css/primitives/spinner/rules.ts +22 -0
- package/src/css/primitives/spinner/spinner.ts +5 -0
- package/src/css/primitives/switch/index.ts +1 -0
- package/src/css/primitives/switch/rules.ts +132 -0
- package/src/css/primitives/switch/switch.ts +5 -0
- package/src/css/primitives/text/index.ts +2 -0
- package/src/css/primitives/text/rules.ts +75 -0
- package/src/css/primitives/text/text.ts +16 -0
- package/src/css/primitives/text/types.ts +11 -0
- package/src/css/primitives/textArea/index.ts +1 -0
- package/src/css/primitives/textArea/rules.ts +5 -0
- package/src/css/primitives/textArea/textArea.ts +5 -0
- package/src/css/primitives/textInput/index.ts +1 -0
- package/src/css/primitives/textInput/rules.ts +226 -0
- package/src/css/primitives/textInput/textInput.ts +7 -0
- package/src/css/primitives/token/rules.ts +45 -0
- package/src/css/primitives/tooltip/index.ts +1 -0
- package/src/css/primitives/tooltip/rules.ts +17 -0
- package/src/css/primitives/tooltip/tooltip.ts +9 -0
- package/src/css/responsiveRules.ts +25 -0
- package/src/css/rules.ts +121 -0
- package/src/css/styles/border/border.ts +22 -0
- package/src/css/styles/border/index.ts +2 -0
- package/src/css/styles/border/rules.ts +24 -0
- package/src/css/styles/border/types.ts +10 -0
- package/src/css/styles/display/rules.ts +62 -0
- package/src/css/styles/flex/flex.ts +20 -0
- package/src/css/styles/flex/index.ts +2 -0
- package/src/css/styles/flex/rules.ts +28 -0
- package/src/css/styles/flex/types.ts +35 -0
- package/src/css/styles/flexItem/flexItem.ts +8 -0
- package/src/css/styles/flexItem/index.ts +2 -0
- package/src/css/styles/flexItem/rules.ts +11 -0
- package/src/css/styles/flexItem/types.ts +11 -0
- package/src/css/styles/font/font.ts +12 -0
- package/src/css/styles/font/index.ts +2 -0
- package/src/css/styles/font/rules.ts +125 -0
- package/src/css/styles/font/types.ts +6 -0
- package/src/css/styles/gap/gap.ts +8 -0
- package/src/css/styles/gap/index.ts +2 -0
- package/src/css/styles/gap/rules.ts +33 -0
- package/src/css/styles/gap/types.ts +9 -0
- package/src/css/styles/grid/rules.ts +35 -0
- package/src/css/styles/gridItem/gridItem.ts +15 -0
- package/src/css/styles/gridItem/index.ts +2 -0
- package/src/css/styles/gridItem/rules.ts +96 -0
- package/src/css/styles/gridItem/types.ts +41 -0
- package/src/css/styles/height/rules.ts +7 -0
- package/src/css/styles/margin/index.ts +2 -0
- package/src/css/styles/margin/margin.ts +15 -0
- package/src/css/styles/margin/rules.ts +59 -0
- package/src/css/styles/margin/types.ts +11 -0
- package/src/css/styles/maxWidth/index.ts +2 -0
- package/src/css/styles/maxWidth/maxWidth.ts +6 -0
- package/src/css/styles/maxWidth/rules.ts +36 -0
- package/src/css/styles/maxWidth/types.ts +6 -0
- package/src/css/styles/overflow/rules.ts +9 -0
- package/src/css/styles/padding/index.ts +2 -0
- package/src/css/styles/padding/padding.ts +15 -0
- package/src/css/styles/padding/rules.ts +59 -0
- package/src/css/styles/padding/types.ts +12 -0
- package/src/css/styles/pointerEvents/index.ts +2 -0
- package/src/css/styles/pointerEvents/pointerEvents.ts +6 -0
- package/src/css/styles/pointerEvents/rules.ts +11 -0
- package/src/css/styles/pointerEvents/types.ts +7 -0
- package/src/css/styles/position/index.ts +2 -0
- package/src/css/styles/position/position.ts +7 -0
- package/src/css/styles/position/rules.ts +31 -0
- package/src/css/styles/position/types.ts +13 -0
- package/src/css/styles/radius/index.ts +2 -0
- package/src/css/styles/radius/radius.ts +8 -0
- package/src/css/styles/radius/rules.ts +13 -0
- package/src/css/styles/radius/types.ts +7 -0
- package/src/css/styles/shadow/rules.ts +53 -0
- package/src/css/styles/width/index.ts +2 -0
- package/src/css/styles/width/rules.ts +7 -0
- package/src/css/styles/width/types.ts +8 -0
- package/src/css/styles/width/width.ts +6 -0
- package/src/css/types.ts +591 -0
- package/src/css/varNames.ts +381 -0
- package/src/css/vars.ts +313 -0
- package/src/theme/build/_deprecated/color/factory.ts +1 -1
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +2 -2
- package/src/theme/build/buildColorTheme.ts +39 -45
- package/src/theme/build/renderColorTheme.ts +65 -239
- package/src/theme/build/resolveColorTokens.ts +115 -51
- package/src/theme/config/tokens/color/types.ts +18 -4
- package/src/theme/defaults/colorTokens.ts +10 -17
- package/src/theme/defaults/config.ts +1 -1
- package/src/theme/getScopedTheme.ts +2 -9
- package/src/theme/system/_constants.ts +25 -0
- package/src/theme/system/_types.ts +41 -0
- package/src/theme/system/color/_constants.ts +0 -8
- package/src/theme/system/color/badge.ts +7 -3
- package/src/theme/system/index.ts +2 -0
- package/src/theme/system/v0/color/_system.ts +4 -8
- package/src/theme/system/v0/color/color.ts +2 -3
- package/src/theme/versioning/themeColor_v0_v2.ts +0 -26
- package/src/theme/versioning/v0_v2.ts +0 -4
- package/src/core/components/breadcrumbs/__workshop__/buttons.tsx +0 -58
- package/src/core/components/dialog/styles.ts +0 -76
|
@@ -0,0 +1,2836 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var fs = require("fs/promises"), path = require("path"), theme = require("@sanity/ui/theme");
|
|
3
|
+
function _interopDefaultCompat(e) {
|
|
4
|
+
return e && typeof e == "object" && "default" in e ? e : { default: e };
|
|
5
|
+
}
|
|
6
|
+
var fs__default = /* @__PURE__ */ _interopDefaultCompat(fs), path__default = /* @__PURE__ */ _interopDefaultCompat(path);
|
|
7
|
+
const breadcrumbsRules = {
|
|
8
|
+
breadcrumbs: {
|
|
9
|
+
lineHeight: 0
|
|
10
|
+
}
|
|
11
|
+
}, dialogRules = {
|
|
12
|
+
dialog: {
|
|
13
|
+
top: 0,
|
|
14
|
+
left: 0,
|
|
15
|
+
right: 0,
|
|
16
|
+
bottom: 0,
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
justifyContent: "center",
|
|
19
|
+
outline: "none",
|
|
20
|
+
background: "var(--color-backdrop)",
|
|
21
|
+
"@keyframes": {
|
|
22
|
+
"dialog-zoom-in": {
|
|
23
|
+
from: {
|
|
24
|
+
opacity: 0,
|
|
25
|
+
transform: "scale(0.95)"
|
|
26
|
+
},
|
|
27
|
+
to: {
|
|
28
|
+
opacity: 1,
|
|
29
|
+
transform: "scale(1)"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"dialog-fade-in": {
|
|
33
|
+
from: {
|
|
34
|
+
opacity: 0
|
|
35
|
+
},
|
|
36
|
+
to: {
|
|
37
|
+
opacity: 1
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"@nest": {
|
|
42
|
+
"&[data-animate]": {
|
|
43
|
+
animation: "dialog-fade-in 200ms ease-out"
|
|
44
|
+
},
|
|
45
|
+
// Animates the dialog card.
|
|
46
|
+
'&[data-animate] > [data-ui="DialogCard"]': {
|
|
47
|
+
animation: "dialog-zoom-in 200ms ease-out"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"dialog-container": {
|
|
52
|
+
width: "100%",
|
|
53
|
+
height: "100%"
|
|
54
|
+
},
|
|
55
|
+
"dialog-card-root": {
|
|
56
|
+
width: "100%",
|
|
57
|
+
maxHeight: "100%",
|
|
58
|
+
overflow: ["hidden", "clip"]
|
|
59
|
+
},
|
|
60
|
+
"dialog-layout": {
|
|
61
|
+
width: "100%"
|
|
62
|
+
},
|
|
63
|
+
"dialog-header": {
|
|
64
|
+
zIndex: 2
|
|
65
|
+
},
|
|
66
|
+
"dialog-content": {
|
|
67
|
+
zIndex: 1,
|
|
68
|
+
outline: "none"
|
|
69
|
+
},
|
|
70
|
+
"dialog-footer": {
|
|
71
|
+
zIndex: 3
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
function responsiveRules(className, props) {
|
|
75
|
+
return {
|
|
76
|
+
[className]: props,
|
|
77
|
+
[`_1:${className}`]: {
|
|
78
|
+
"@media": { "screen and (min-width: 360px)": props }
|
|
79
|
+
},
|
|
80
|
+
[`_2:${className}`]: {
|
|
81
|
+
"@media": { "screen and (min-width: 600px)": props }
|
|
82
|
+
},
|
|
83
|
+
[`_3:${className}`]: {
|
|
84
|
+
"@media": { "screen and (min-width: 900px)": props }
|
|
85
|
+
},
|
|
86
|
+
[`_4:${className}`]: {
|
|
87
|
+
"@media": { "screen and (min-width: 1200px)": props }
|
|
88
|
+
},
|
|
89
|
+
[`_5:${className}`]: {
|
|
90
|
+
"@media": { "screen and (min-width: 1800px)": props }
|
|
91
|
+
},
|
|
92
|
+
[`_6:${className}`]: {
|
|
93
|
+
"@media": { "screen and (min-width: 2400px)": props }
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const avatarRules = {
|
|
98
|
+
avatar: {
|
|
99
|
+
backgroundColor: "var(--avatar-bg-color)",
|
|
100
|
+
position: "relative",
|
|
101
|
+
boxSizing: "border-box",
|
|
102
|
+
userSelect: "none",
|
|
103
|
+
boxShadow: "0 0 0 1px var(--card-bg-color)",
|
|
104
|
+
"@nest": {
|
|
105
|
+
'&[data-status="inactive"]': {
|
|
106
|
+
opacity: 0.5
|
|
107
|
+
},
|
|
108
|
+
"& > svg:not([hidden])": {
|
|
109
|
+
display: "block"
|
|
110
|
+
},
|
|
111
|
+
/* &:is(button) */
|
|
112
|
+
'&[data-as="button"]': {
|
|
113
|
+
WebkitFontSmoothing: "inherit",
|
|
114
|
+
appearance: "none",
|
|
115
|
+
margin: 0,
|
|
116
|
+
padding: 0,
|
|
117
|
+
border: 0,
|
|
118
|
+
font: "inherit",
|
|
119
|
+
color: "inherit",
|
|
120
|
+
outline: "none"
|
|
121
|
+
},
|
|
122
|
+
'&[data-as="button"]:focus': {
|
|
123
|
+
// boxShadow: focusRingStyle({focusRing: avatar.focusRing}),
|
|
124
|
+
},
|
|
125
|
+
'&[data-as="button"]:focus:not(:focus-visible)': {
|
|
126
|
+
boxShadow: "none"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
...theme.THEME_COLOR_AVATAR_COLORS.reduce((acc, color) => ({
|
|
131
|
+
...acc,
|
|
132
|
+
[`avatar-${color}`]: {
|
|
133
|
+
"--avatar-bg-color": `var(--card-avatar-${color}-bg-color)`,
|
|
134
|
+
"--avatar-fg-color": `var(--card-avatar-${color}-fg-color)`
|
|
135
|
+
}
|
|
136
|
+
}), {}),
|
|
137
|
+
"avatar-arrow": {
|
|
138
|
+
position: "absolute",
|
|
139
|
+
boxSizing: "border-box",
|
|
140
|
+
zIndex: 0,
|
|
141
|
+
opacity: 0,
|
|
142
|
+
transition: "all 0.2s linear",
|
|
143
|
+
transform: "rotate(-90deg) translate3d(0, 6px, 0)",
|
|
144
|
+
left: 0,
|
|
145
|
+
right: 0,
|
|
146
|
+
top: 0,
|
|
147
|
+
bottom: 0,
|
|
148
|
+
"@nest": {
|
|
149
|
+
"& > svg": {
|
|
150
|
+
width: "11px",
|
|
151
|
+
height: "7px",
|
|
152
|
+
position: "absolute",
|
|
153
|
+
top: "-5px",
|
|
154
|
+
left: "50%",
|
|
155
|
+
transform: "translateX(-6px)"
|
|
156
|
+
},
|
|
157
|
+
"& > svg:not([hidden])": {
|
|
158
|
+
display: "block"
|
|
159
|
+
},
|
|
160
|
+
".arrow-position-inside > &": {
|
|
161
|
+
transform: "rotate(-90deg) translate3d(0, 6px, 0)",
|
|
162
|
+
opacity: 0
|
|
163
|
+
},
|
|
164
|
+
".arrow-position-top > &": {
|
|
165
|
+
opacity: 1,
|
|
166
|
+
transform: "rotate(0deg)"
|
|
167
|
+
},
|
|
168
|
+
".arrow-position-bottom > &": {
|
|
169
|
+
opacity: 1,
|
|
170
|
+
transform: "rotate(-180deg)"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
...responsiveRules("avatar-0", {
|
|
175
|
+
width: "var(--avatar-0-size)",
|
|
176
|
+
height: "var(--avatar-0-size)",
|
|
177
|
+
borderRadius: "var(--avatar-0-size)",
|
|
178
|
+
"@nest": {
|
|
179
|
+
"& > svg": {
|
|
180
|
+
width: "var(--avatar-0-size)",
|
|
181
|
+
height: "var(--avatar-0-size)",
|
|
182
|
+
borderRadius: "var(--avatar-0-size)"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}),
|
|
186
|
+
...responsiveRules("avatar-1", {
|
|
187
|
+
width: "var(--avatar-1-size)",
|
|
188
|
+
height: "var(--avatar-1-size)",
|
|
189
|
+
borderRadius: "var(--avatar-1-size)",
|
|
190
|
+
"@nest": {
|
|
191
|
+
"& > svg": {
|
|
192
|
+
width: "var(--avatar-1-size)",
|
|
193
|
+
height: "var(--avatar-1-size)",
|
|
194
|
+
borderRadius: "var(--avatar-1-size)"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}),
|
|
198
|
+
...responsiveRules("avatar-2", {
|
|
199
|
+
width: "var(--avatar-2-size)",
|
|
200
|
+
height: "var(--avatar-2-size)",
|
|
201
|
+
borderRadius: "var(--avatar-2-size)",
|
|
202
|
+
"@nest": {
|
|
203
|
+
"& > svg": {
|
|
204
|
+
width: "var(--avatar-2-size)",
|
|
205
|
+
height: "var(--avatar-2-size)",
|
|
206
|
+
borderRadius: "var(--avatar-2-size)"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}),
|
|
210
|
+
...responsiveRules("avatar-3", {
|
|
211
|
+
width: "var(--avatar-3-size)",
|
|
212
|
+
height: "var(--avatar-3-size)",
|
|
213
|
+
borderRadius: "var(--avatar-3-size)",
|
|
214
|
+
"@nest": {
|
|
215
|
+
"& > svg": {
|
|
216
|
+
width: "var(--avatar-3-size)",
|
|
217
|
+
height: "var(--avatar-3-size)",
|
|
218
|
+
borderRadius: "var(--avatar-3-size)"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}),
|
|
222
|
+
"avatar-initials": {
|
|
223
|
+
width: "100%",
|
|
224
|
+
height: "100%",
|
|
225
|
+
color: "var(--avatar-fg-color)",
|
|
226
|
+
alignItems: "center",
|
|
227
|
+
justifyContent: "center",
|
|
228
|
+
textTransform: "uppercase",
|
|
229
|
+
textAlign: "center",
|
|
230
|
+
borderRadius: "50%",
|
|
231
|
+
"@nest": {
|
|
232
|
+
"&:not([hidden])": {
|
|
233
|
+
display: "flex"
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"avatar-bg-stroke": {
|
|
238
|
+
strokeWidth: "4px",
|
|
239
|
+
stroke: "var(--card-bg-color)"
|
|
240
|
+
},
|
|
241
|
+
"avatar-stroke": {
|
|
242
|
+
strokeWidth: "2px",
|
|
243
|
+
stroke: "var(--avatar-bg-color)",
|
|
244
|
+
"@nest": {
|
|
245
|
+
'[data-status="editing"] &': {
|
|
246
|
+
strokeDasharray: "2 4",
|
|
247
|
+
strokeLinecap: "round"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
"avatar-image": {
|
|
252
|
+
position: "relative"
|
|
253
|
+
}
|
|
254
|
+
}, varNames = {
|
|
255
|
+
color: {
|
|
256
|
+
dark: {
|
|
257
|
+
transparent: buildColorCardVarNames({ scheme: "dark", tone: "transparent" }),
|
|
258
|
+
default: buildColorCardVarNames({ scheme: "dark", tone: "default" }),
|
|
259
|
+
primary: buildColorCardVarNames({ scheme: "dark", tone: "primary" }),
|
|
260
|
+
positive: buildColorCardVarNames({ scheme: "dark", tone: "positive" }),
|
|
261
|
+
caution: buildColorCardVarNames({ scheme: "dark", tone: "caution" }),
|
|
262
|
+
critical: buildColorCardVarNames({ scheme: "dark", tone: "critical" })
|
|
263
|
+
},
|
|
264
|
+
light: {
|
|
265
|
+
transparent: buildColorCardVarNames({ scheme: "light", tone: "transparent" }),
|
|
266
|
+
default: buildColorCardVarNames({ scheme: "light", tone: "default" }),
|
|
267
|
+
primary: buildColorCardVarNames({ scheme: "light", tone: "primary" }),
|
|
268
|
+
positive: buildColorCardVarNames({ scheme: "light", tone: "positive" }),
|
|
269
|
+
caution: buildColorCardVarNames({ scheme: "light", tone: "caution" }),
|
|
270
|
+
critical: buildColorCardVarNames({ scheme: "light", tone: "critical" })
|
|
271
|
+
},
|
|
272
|
+
//
|
|
273
|
+
accent: {
|
|
274
|
+
fg: "--color-accent-fg"
|
|
275
|
+
},
|
|
276
|
+
avatar: {
|
|
277
|
+
gray: {
|
|
278
|
+
bg: "--color-avatar-gray-bg",
|
|
279
|
+
fg: "--color-avatar-gray-fg"
|
|
280
|
+
},
|
|
281
|
+
blue: {
|
|
282
|
+
bg: "--color-avatar-blue-bg",
|
|
283
|
+
fg: "--color-avatar-blue-fg"
|
|
284
|
+
},
|
|
285
|
+
purple: {
|
|
286
|
+
bg: "--color-avatar-purple-bg",
|
|
287
|
+
fg: "--color-avatar-purple-fg"
|
|
288
|
+
},
|
|
289
|
+
magenta: {
|
|
290
|
+
bg: "--color-avatar-magenta-bg",
|
|
291
|
+
fg: "--color-avatar-magenta-fg"
|
|
292
|
+
},
|
|
293
|
+
red: {
|
|
294
|
+
bg: "--color-avatar-red-bg",
|
|
295
|
+
fg: "--color-avatar-red-fg"
|
|
296
|
+
},
|
|
297
|
+
orange: {
|
|
298
|
+
bg: "--color-avatar-orange-bg",
|
|
299
|
+
fg: "--color-avatar-orange-fg"
|
|
300
|
+
},
|
|
301
|
+
yellow: {
|
|
302
|
+
bg: "--color-avatar-yellow-bg",
|
|
303
|
+
fg: "--color-avatar-yellow-fg"
|
|
304
|
+
},
|
|
305
|
+
green: {
|
|
306
|
+
bg: "--color-avatar-green-bg",
|
|
307
|
+
fg: "--color-avatar-green-fg"
|
|
308
|
+
},
|
|
309
|
+
cyan: {
|
|
310
|
+
bg: "--color-avatar-cyan-bg",
|
|
311
|
+
fg: "--color-avatar-cyan-fg"
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
badge: {
|
|
315
|
+
bg: "--color-badge-bg",
|
|
316
|
+
dot: "--color-badge-dot",
|
|
317
|
+
fg: "--color-badge-fg",
|
|
318
|
+
icon: "--color-badge-icon",
|
|
319
|
+
default: {
|
|
320
|
+
bg: "--color-badge-default-bg",
|
|
321
|
+
dot: "--color-badge-default-dot",
|
|
322
|
+
fg: "--color-badge-default-fg",
|
|
323
|
+
icon: "--color-badge-default-icon"
|
|
324
|
+
},
|
|
325
|
+
primary: {
|
|
326
|
+
bg: "--color-badge-primary-bg",
|
|
327
|
+
dot: "--color-badge-primary-dot",
|
|
328
|
+
fg: "--color-badge-primary-fg",
|
|
329
|
+
icon: "--color-badge-primary-icon"
|
|
330
|
+
},
|
|
331
|
+
positive: {
|
|
332
|
+
bg: "--color-badge-positive-bg",
|
|
333
|
+
dot: "--color-badge-positive-dot",
|
|
334
|
+
fg: "--color-badge-positive-fg",
|
|
335
|
+
icon: "--color-badge-positive-icon"
|
|
336
|
+
},
|
|
337
|
+
caution: {
|
|
338
|
+
bg: "--color-badge-caution-bg",
|
|
339
|
+
dot: "--color-badge-caution-dot",
|
|
340
|
+
fg: "--color-badge-caution-fg",
|
|
341
|
+
icon: "--color-badge-caution-icon"
|
|
342
|
+
},
|
|
343
|
+
critical: {
|
|
344
|
+
bg: "--color-badge-critical-bg",
|
|
345
|
+
dot: "--color-badge-critical-dot",
|
|
346
|
+
fg: "--color-badge-critical-fg",
|
|
347
|
+
icon: "--color-badge-critical-icon"
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
bg: "--color-bg",
|
|
351
|
+
border: "--color-border",
|
|
352
|
+
code: {
|
|
353
|
+
bg: "--color-code-bg",
|
|
354
|
+
fg: "--color-code-fg"
|
|
355
|
+
},
|
|
356
|
+
fg: "--color-fg",
|
|
357
|
+
icon: "--color-icon",
|
|
358
|
+
kbd: {
|
|
359
|
+
bg: "--color-kbd-bg",
|
|
360
|
+
border: "--color-kbd-border",
|
|
361
|
+
fg: "--color-kbd-fg"
|
|
362
|
+
},
|
|
363
|
+
link: {
|
|
364
|
+
fg: "--color-link-fg"
|
|
365
|
+
},
|
|
366
|
+
muted: {
|
|
367
|
+
bg: "--color-muted-bg",
|
|
368
|
+
fg: "--color-muted-fg"
|
|
369
|
+
},
|
|
370
|
+
shadow: {
|
|
371
|
+
outline: "--color-shadow-outline",
|
|
372
|
+
umbra: "--color-shadow-umbra",
|
|
373
|
+
penumbra: "--color-shadow-penumbra",
|
|
374
|
+
ambient: "--color-shadow-ambient"
|
|
375
|
+
},
|
|
376
|
+
skeleton: {
|
|
377
|
+
from: "--color-skeleton-from",
|
|
378
|
+
to: "--color-skeleton-to"
|
|
379
|
+
},
|
|
380
|
+
syntax: {
|
|
381
|
+
atrule: "--color-syntax-atrule",
|
|
382
|
+
attrName: "--color-syntax-attrName",
|
|
383
|
+
attrValue: "--color-syntax-attrValue",
|
|
384
|
+
attribute: "--color-syntax-attribute",
|
|
385
|
+
boolean: "--color-syntax-boolean",
|
|
386
|
+
builtin: "--color-syntax-builtin",
|
|
387
|
+
cdata: "--color-syntax-cdata",
|
|
388
|
+
char: "--color-syntax-char",
|
|
389
|
+
class: "--color-syntax-class",
|
|
390
|
+
className: "--color-syntax-className",
|
|
391
|
+
comment: "--color-syntax-comment",
|
|
392
|
+
constant: "--color-syntax-constant",
|
|
393
|
+
deleted: "--color-syntax-deleted",
|
|
394
|
+
doctype: "--color-syntax-doctype",
|
|
395
|
+
entity: "--color-syntax-entity",
|
|
396
|
+
function: "--color-syntax-function",
|
|
397
|
+
hexcode: "--color-syntax-hexcode",
|
|
398
|
+
id: "--color-syntax-id",
|
|
399
|
+
important: "--color-syntax-important",
|
|
400
|
+
inserted: "--color-syntax-inserted",
|
|
401
|
+
keyword: "--color-syntax-keyword",
|
|
402
|
+
number: "--color-syntax-number",
|
|
403
|
+
operator: "--color-syntax-operator",
|
|
404
|
+
prolog: "--color-syntax-prolog",
|
|
405
|
+
property: "--color-syntax-property",
|
|
406
|
+
pseudoClass: "--color-syntax-pseudoClass",
|
|
407
|
+
pseudoElement: "--color-syntax-pseudoElement",
|
|
408
|
+
punctuation: "--color-syntax-punctuation",
|
|
409
|
+
regex: "--color-syntax-regex",
|
|
410
|
+
selector: "--color-syntax-selector",
|
|
411
|
+
string: "--color-syntax-string",
|
|
412
|
+
symbol: "--color-syntax-symbol",
|
|
413
|
+
tag: "--color-syntax-tag",
|
|
414
|
+
unit: "--color-syntax-unit",
|
|
415
|
+
url: "--color-syntax-url",
|
|
416
|
+
variable: "--color-syntax-variable"
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
avatar: {
|
|
420
|
+
focusRing: {
|
|
421
|
+
offset: "--avatar-focus-ring-offset",
|
|
422
|
+
width: "--avatar-focus-ring-width"
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
space: Object.fromEntries(
|
|
426
|
+
theme.SPACE.map((space) => [space, `--space-${space}`])
|
|
427
|
+
)
|
|
428
|
+
};
|
|
429
|
+
function buildColorCardVarNames(props) {
|
|
430
|
+
const { scheme, tone } = props, prefix = `--color-${scheme}-${tone}`;
|
|
431
|
+
return {
|
|
432
|
+
accent: {
|
|
433
|
+
fg: `${prefix}-accent-fg`
|
|
434
|
+
},
|
|
435
|
+
avatar: {
|
|
436
|
+
gray: {
|
|
437
|
+
bg: `${prefix}-avatar-gray-bg`,
|
|
438
|
+
fg: `${prefix}-avatar-gray-fg`
|
|
439
|
+
},
|
|
440
|
+
blue: {
|
|
441
|
+
bg: `${prefix}-avatar-blue-bg`,
|
|
442
|
+
fg: `${prefix}-avatar-blue-fg`
|
|
443
|
+
},
|
|
444
|
+
purple: {
|
|
445
|
+
bg: `${prefix}-avatar-purple-bg`,
|
|
446
|
+
fg: `${prefix}-avatar-purple-fg`
|
|
447
|
+
},
|
|
448
|
+
magenta: {
|
|
449
|
+
bg: `${prefix}-avatar-magenta-bg`,
|
|
450
|
+
fg: `${prefix}-avatar-magenta-fg`
|
|
451
|
+
},
|
|
452
|
+
red: {
|
|
453
|
+
bg: `${prefix}-avatar-red-bg`,
|
|
454
|
+
fg: `${prefix}-avatar-red-fg`
|
|
455
|
+
},
|
|
456
|
+
orange: {
|
|
457
|
+
bg: `${prefix}-avatar-orange-bg`,
|
|
458
|
+
fg: `${prefix}-avatar-gray-fg`
|
|
459
|
+
},
|
|
460
|
+
yellow: {
|
|
461
|
+
bg: `${prefix}-avatar-yellow-bg`,
|
|
462
|
+
fg: `${prefix}-avatar-yellow-fg`
|
|
463
|
+
},
|
|
464
|
+
green: {
|
|
465
|
+
bg: `${prefix}-avatar-green-bg`,
|
|
466
|
+
fg: `${prefix}-avatar-green-fg`
|
|
467
|
+
},
|
|
468
|
+
cyan: {
|
|
469
|
+
bg: `${prefix}-avatar-cyan-bg`,
|
|
470
|
+
fg: `${prefix}-avatar-yellow-fg`
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
backdrop: `${prefix}-backdrop`,
|
|
474
|
+
badge: {
|
|
475
|
+
default: {
|
|
476
|
+
bg: `${prefix}-badge-default-bg`,
|
|
477
|
+
dot: `${prefix}-badge-default-dot`,
|
|
478
|
+
fg: `${prefix}-badge-default-fg`,
|
|
479
|
+
icon: `${prefix}-badge-default-icon`
|
|
480
|
+
},
|
|
481
|
+
primary: {
|
|
482
|
+
bg: `${prefix}-badge-primary-bg`,
|
|
483
|
+
dot: `${prefix}-badge-primary-dot`,
|
|
484
|
+
fg: `${prefix}-badge-primary-fg`,
|
|
485
|
+
icon: `${prefix}-badge-primary-icon`
|
|
486
|
+
},
|
|
487
|
+
positive: {
|
|
488
|
+
bg: `${prefix}-badge-positive-bg`,
|
|
489
|
+
dot: `${prefix}-badge-positive-dot`,
|
|
490
|
+
fg: `${prefix}-badge-positive-fg`,
|
|
491
|
+
icon: `${prefix}-badge-positive-icon`
|
|
492
|
+
},
|
|
493
|
+
caution: {
|
|
494
|
+
bg: `${prefix}-badge-caution-bg`,
|
|
495
|
+
dot: `${prefix}-badge-caution-dot`,
|
|
496
|
+
fg: `${prefix}-badge-caution-fg`,
|
|
497
|
+
icon: `${prefix}-badge-caution-icon`
|
|
498
|
+
},
|
|
499
|
+
critical: {
|
|
500
|
+
bg: `${prefix}-badge-critical-bg`,
|
|
501
|
+
dot: `${prefix}-badge-critical-dot`,
|
|
502
|
+
fg: `${prefix}-badge-critical-fg`,
|
|
503
|
+
icon: `${prefix}-badge-critical-icon`
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
bg: `${prefix}-bg`,
|
|
507
|
+
border: `${prefix}-border`,
|
|
508
|
+
code: {
|
|
509
|
+
bg: `${prefix}-code-bg`,
|
|
510
|
+
fg: `${prefix}-code-fg`
|
|
511
|
+
},
|
|
512
|
+
fg: `${prefix}-fg`,
|
|
513
|
+
focusRing: `${prefix}-focus-ring`,
|
|
514
|
+
icon: `${prefix}-icon`,
|
|
515
|
+
input: {
|
|
516
|
+
default: {
|
|
517
|
+
enabled: buildColorInputStateVarNames({ mode: "default", scheme, state: "enabled", tone }),
|
|
518
|
+
hovered: buildColorInputStateVarNames({ mode: "default", scheme, state: "hovered", tone }),
|
|
519
|
+
readOnly: buildColorInputStateVarNames({ mode: "default", scheme, state: "readOnly", tone }),
|
|
520
|
+
disabled: buildColorInputStateVarNames({ mode: "default", scheme, state: "disabled", tone })
|
|
521
|
+
},
|
|
522
|
+
invalid: {
|
|
523
|
+
enabled: buildColorInputStateVarNames({ mode: "invalid", scheme, state: "enabled", tone }),
|
|
524
|
+
hovered: buildColorInputStateVarNames({ mode: "invalid", scheme, state: "hovered", tone }),
|
|
525
|
+
readOnly: buildColorInputStateVarNames({ mode: "invalid", scheme, state: "readOnly", tone }),
|
|
526
|
+
disabled: buildColorInputStateVarNames({ mode: "invalid", scheme, state: "disabled", tone })
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
kbd: {
|
|
530
|
+
bg: `${prefix}-kbd-bg`,
|
|
531
|
+
border: `${prefix}-kbd-border`,
|
|
532
|
+
fg: `${prefix}-kbd-fg`
|
|
533
|
+
},
|
|
534
|
+
link: {
|
|
535
|
+
fg: `${prefix}-link-fg`
|
|
536
|
+
},
|
|
537
|
+
muted: {
|
|
538
|
+
bg: `${prefix}-muted-bg`,
|
|
539
|
+
fg: `${prefix}-muted-fg`
|
|
540
|
+
},
|
|
541
|
+
skeleton: {
|
|
542
|
+
from: `${prefix}-skeleton-from`,
|
|
543
|
+
to: `${prefix}-skeleton-to`
|
|
544
|
+
},
|
|
545
|
+
shadow: {
|
|
546
|
+
outline: `${prefix}-shadow-outline`,
|
|
547
|
+
umbra: `${prefix}-shadow-umbra`,
|
|
548
|
+
penumbra: `${prefix}-shadow-penumbra`,
|
|
549
|
+
ambient: `${prefix}-shadow-ambient`
|
|
550
|
+
},
|
|
551
|
+
syntax: {
|
|
552
|
+
atrule: `${prefix}-syntax-atrule`,
|
|
553
|
+
attrName: `${prefix}-syntax-attrName`,
|
|
554
|
+
attrValue: `${prefix}-syntax-attrValue`,
|
|
555
|
+
attribute: `${prefix}-syntax-attribute`,
|
|
556
|
+
boolean: `${prefix}-syntax-boolean`,
|
|
557
|
+
builtin: `${prefix}-syntax-builtin`,
|
|
558
|
+
cdata: `${prefix}-syntax-cdata`,
|
|
559
|
+
char: `${prefix}-syntax-char`,
|
|
560
|
+
class: `${prefix}-syntax-class`,
|
|
561
|
+
className: `${prefix}-syntax-className`,
|
|
562
|
+
comment: `${prefix}-syntax-comment`,
|
|
563
|
+
constant: `${prefix}-syntax-constant`,
|
|
564
|
+
deleted: `${prefix}-syntax-deleted`,
|
|
565
|
+
doctype: `${prefix}-syntax-doctype`,
|
|
566
|
+
entity: `${prefix}-syntax-entity`,
|
|
567
|
+
function: `${prefix}-syntax-function`,
|
|
568
|
+
hexcode: `${prefix}-syntax-hexcode`,
|
|
569
|
+
id: `${prefix}-syntax-id`,
|
|
570
|
+
important: `${prefix}-syntax-important`,
|
|
571
|
+
inserted: `${prefix}-syntax-inserted`,
|
|
572
|
+
keyword: `${prefix}-syntax-keyword`,
|
|
573
|
+
number: `${prefix}-syntax-number`,
|
|
574
|
+
operator: `${prefix}-syntax-operator`,
|
|
575
|
+
prolog: `${prefix}-syntax-prolog`,
|
|
576
|
+
property: `${prefix}-syntax-property`,
|
|
577
|
+
pseudoClass: `${prefix}-syntax-pseudoClass`,
|
|
578
|
+
pseudoElement: `${prefix}-syntax-pseudoElement`,
|
|
579
|
+
punctuation: `${prefix}-syntax-punctuation`,
|
|
580
|
+
regex: `${prefix}-syntax-regex`,
|
|
581
|
+
selector: `${prefix}-syntax-selector`,
|
|
582
|
+
string: `${prefix}-syntax-string`,
|
|
583
|
+
symbol: `${prefix}-syntax-symbol`,
|
|
584
|
+
tag: `${prefix}-syntax-tag`,
|
|
585
|
+
unit: `${prefix}-syntax-unit`,
|
|
586
|
+
url: `${prefix}-syntax-url`,
|
|
587
|
+
variable: `${prefix}-syntax-variable`
|
|
588
|
+
}
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
function buildColorInputStateVarNames(props) {
|
|
592
|
+
const { mode, scheme, state, tone } = props, prefix = `--color-${scheme}-${tone}-input-${mode}-${state}`;
|
|
593
|
+
return {
|
|
594
|
+
bg: `${prefix}-bg`,
|
|
595
|
+
border: `${prefix}-border`,
|
|
596
|
+
fg: `${prefix}-fg`,
|
|
597
|
+
muted: {
|
|
598
|
+
bg: `${prefix}-muted-bg`
|
|
599
|
+
},
|
|
600
|
+
placeholder: `${prefix}-placeholder`
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
const vars = {
|
|
604
|
+
color: {
|
|
605
|
+
dark: theme.THEME_COLOR_CARD_TONES.reduce((acc, tone) => ({
|
|
606
|
+
...acc,
|
|
607
|
+
[tone]: buildColorCardVars({ scheme: "dark", tone })
|
|
608
|
+
}), {}),
|
|
609
|
+
light: theme.THEME_COLOR_CARD_TONES.reduce((acc, tone) => ({
|
|
610
|
+
...acc,
|
|
611
|
+
[tone]: buildColorCardVars({ scheme: "light", tone })
|
|
612
|
+
}), {}),
|
|
613
|
+
accent: {
|
|
614
|
+
fg: "var(--color-accent-fg)"
|
|
615
|
+
},
|
|
616
|
+
avatar: {
|
|
617
|
+
...theme.THEME_COLOR_AVATAR_COLORS.reduce((acc, color) => ({
|
|
618
|
+
...acc,
|
|
619
|
+
[color]: {
|
|
620
|
+
bg: `var(--color-avatar-${color}-bg)`,
|
|
621
|
+
fg: `var(--color-avatar-${color}-fg)`
|
|
622
|
+
}
|
|
623
|
+
}), {})
|
|
624
|
+
},
|
|
625
|
+
badge: {
|
|
626
|
+
bg: "var(--color-badge-bg)",
|
|
627
|
+
dot: "var(--color-badge-dot)",
|
|
628
|
+
fg: "var(--color-badge-fg)",
|
|
629
|
+
icon: "var(--color-badge-icon)",
|
|
630
|
+
...theme.THEME_COLOR_STATE_TONES.reduce((acc, tone) => ({
|
|
631
|
+
...acc,
|
|
632
|
+
[tone]: {
|
|
633
|
+
bg: `var(--color-badge-${tone}-bg)`,
|
|
634
|
+
dot: `var(--color-badge-${tone}-dot)`,
|
|
635
|
+
fg: `var(--color-badge-${tone}-fg)`,
|
|
636
|
+
icon: `var(--color-badge-${tone}-icon)`
|
|
637
|
+
}
|
|
638
|
+
}), {})
|
|
639
|
+
},
|
|
640
|
+
bg: "var(--color-bg)",
|
|
641
|
+
border: "var(--color-border)",
|
|
642
|
+
code: {
|
|
643
|
+
bg: "var(--color-code-bg)",
|
|
644
|
+
fg: "var(--color-code-fg)"
|
|
645
|
+
},
|
|
646
|
+
fg: "var(--color-fg)",
|
|
647
|
+
icon: "var(--color-icon)",
|
|
648
|
+
input: {
|
|
649
|
+
...theme.THEME_COLOR_INPUT_MODES.reduce((acc, mode) => ({
|
|
650
|
+
...acc,
|
|
651
|
+
[mode]: {
|
|
652
|
+
...theme.THEME_COLOR_INPUT_STATES.reduce((acc2, state) => ({
|
|
653
|
+
...acc2,
|
|
654
|
+
[state]: {
|
|
655
|
+
bg: "var(--color-bg)",
|
|
656
|
+
border: "var(--color-border)",
|
|
657
|
+
fg: "var(--color-fg)",
|
|
658
|
+
muted: {
|
|
659
|
+
fg: "var(--color-muted-fg)"
|
|
660
|
+
},
|
|
661
|
+
placeholder: "var(--color-placeholder)"
|
|
662
|
+
}
|
|
663
|
+
}), {})
|
|
664
|
+
}
|
|
665
|
+
}), {})
|
|
666
|
+
},
|
|
667
|
+
kbd: {
|
|
668
|
+
bg: "var(--color-kbd-bg)",
|
|
669
|
+
border: "var(--color-kbd-border)",
|
|
670
|
+
fg: "var(--color-kbd-fg)"
|
|
671
|
+
},
|
|
672
|
+
link: {
|
|
673
|
+
fg: "var(--color-link-fg)"
|
|
674
|
+
},
|
|
675
|
+
muted: {
|
|
676
|
+
bg: "var(--color-muted-bg)",
|
|
677
|
+
fg: "var(--color-muted-fg)"
|
|
678
|
+
},
|
|
679
|
+
shadow: {
|
|
680
|
+
outline: "var(--color-shadow-outline)",
|
|
681
|
+
umbra: "var(--color-shadow-umbra)",
|
|
682
|
+
penumbra: "var(--color-shadow-penumbra)",
|
|
683
|
+
ambient: "var(--color-shadow-ambient)"
|
|
684
|
+
},
|
|
685
|
+
skeleton: {
|
|
686
|
+
from: "var(--color-skeleton-from)",
|
|
687
|
+
to: "var(--color-skeleton-to)"
|
|
688
|
+
},
|
|
689
|
+
syntax: {
|
|
690
|
+
atrule: "var(--color-syntax-atrule)",
|
|
691
|
+
attrName: "var(--color-syntax-attrName)",
|
|
692
|
+
attrValue: "var(--color-syntax-attrValue)",
|
|
693
|
+
attribute: "var(--color-syntax-attribute)",
|
|
694
|
+
boolean: "var(--color-syntax-boolean)",
|
|
695
|
+
builtin: "var(--color-syntax-builtin)",
|
|
696
|
+
cdata: "var(--color-syntax-cdata)",
|
|
697
|
+
char: "var(--color-syntax-char)",
|
|
698
|
+
class: "var(--color-syntax-class)",
|
|
699
|
+
className: "var(--color-syntax-className)",
|
|
700
|
+
comment: "var(--color-syntax-comment)",
|
|
701
|
+
constant: "var(--color-syntax-constant)",
|
|
702
|
+
deleted: "var(--color-syntax-deleted)",
|
|
703
|
+
doctype: "var(--color-syntax-doctype)",
|
|
704
|
+
entity: "var(--color-syntax-entity)",
|
|
705
|
+
function: "var(--color-syntax-function)",
|
|
706
|
+
hexcode: "var(--color-syntax-hexcode)",
|
|
707
|
+
id: "var(--color-syntax-id)",
|
|
708
|
+
important: "var(--color-syntax-important)",
|
|
709
|
+
inserted: "var(--color-syntax-inserted)",
|
|
710
|
+
keyword: "var(--color-syntax-keyword)",
|
|
711
|
+
number: "var(--color-syntax-number)",
|
|
712
|
+
operator: "var(--color-syntax-operator)",
|
|
713
|
+
prolog: "var(--color-syntax-prolog)",
|
|
714
|
+
property: "var(--color-syntax-property)",
|
|
715
|
+
pseudoClass: "var(--color-syntax-pseudoClass)",
|
|
716
|
+
pseudoElement: "var(--color-syntax-pseudoElement)",
|
|
717
|
+
punctuation: "var(--color-syntax-punctuation)",
|
|
718
|
+
regex: "var(--color-syntax-regex)",
|
|
719
|
+
selector: "var(--color-syntax-selector)",
|
|
720
|
+
string: "var(--color-syntax-string)",
|
|
721
|
+
symbol: "var(--color-syntax-symbol)",
|
|
722
|
+
tag: "var(--color-syntax-tag)",
|
|
723
|
+
unit: "var(--color-syntax-unit)",
|
|
724
|
+
url: "var(--color-syntax-url)",
|
|
725
|
+
variable: "var(--color-syntax-variable)"
|
|
726
|
+
}
|
|
727
|
+
},
|
|
728
|
+
space: Object.fromEntries(
|
|
729
|
+
theme.SPACE.map((space) => [space, `var(${varNames.space[space]})`])
|
|
730
|
+
)
|
|
731
|
+
};
|
|
732
|
+
function buildColorCardVars(props) {
|
|
733
|
+
const { scheme, tone } = props, prefix = `--color-${scheme}-${tone}`;
|
|
734
|
+
return {
|
|
735
|
+
accent: {
|
|
736
|
+
fg: `var(${prefix}-accent-fg)`
|
|
737
|
+
},
|
|
738
|
+
avatar: {
|
|
739
|
+
...theme.THEME_COLOR_AVATAR_COLORS.reduce((acc, color) => ({
|
|
740
|
+
...acc,
|
|
741
|
+
[color]: {
|
|
742
|
+
bg: `var(${prefix}-avatar-${color}-bg)`,
|
|
743
|
+
fg: `var(${prefix}-avatar-${color}-fg)`
|
|
744
|
+
}
|
|
745
|
+
}), {})
|
|
746
|
+
},
|
|
747
|
+
backdrop: `var(${prefix}-backdrop)`,
|
|
748
|
+
badge: {
|
|
749
|
+
...theme.THEME_COLOR_STATE_TONES.reduce((acc, tone2) => ({
|
|
750
|
+
...acc,
|
|
751
|
+
[tone2]: {
|
|
752
|
+
bg: `var(${prefix}-badge-${tone2}-bg)`,
|
|
753
|
+
dot: `var(${prefix}-badge-${tone2}-dot)`,
|
|
754
|
+
fg: `var(${prefix}-badge-${tone2}-fg)`,
|
|
755
|
+
icon: `var(${prefix}-badge-${tone2}-icon)`
|
|
756
|
+
}
|
|
757
|
+
}), {})
|
|
758
|
+
},
|
|
759
|
+
bg: `var(${prefix}-bg)`,
|
|
760
|
+
border: `var(${prefix}-border)`,
|
|
761
|
+
code: {
|
|
762
|
+
bg: `var(${prefix}-code-bg)`,
|
|
763
|
+
fg: `var(${prefix}-code-fg)`
|
|
764
|
+
},
|
|
765
|
+
fg: `var(${prefix}-fg)`,
|
|
766
|
+
focusRing: `var(${prefix}-focus-ring)`,
|
|
767
|
+
icon: `var(${prefix}-icon)`,
|
|
768
|
+
input: {
|
|
769
|
+
...theme.THEME_COLOR_INPUT_MODES.reduce((acc, mode) => ({
|
|
770
|
+
...acc,
|
|
771
|
+
[mode]: {
|
|
772
|
+
...theme.THEME_COLOR_INPUT_STATES.reduce((acc2, state) => ({
|
|
773
|
+
...acc2,
|
|
774
|
+
[state]: buildColorInputStateVars({ mode, scheme, state, tone })
|
|
775
|
+
}), {})
|
|
776
|
+
}
|
|
777
|
+
}), {})
|
|
778
|
+
},
|
|
779
|
+
kbd: {
|
|
780
|
+
bg: `var(${prefix}-kbd-bg)`,
|
|
781
|
+
border: `var(${prefix}-kbd-border)`,
|
|
782
|
+
fg: `var(${prefix}-kbd-fg)`
|
|
783
|
+
},
|
|
784
|
+
link: {
|
|
785
|
+
fg: `var(${prefix}-link-fg)`
|
|
786
|
+
},
|
|
787
|
+
muted: {
|
|
788
|
+
bg: `var(${prefix}-muted-bg)`,
|
|
789
|
+
fg: `var(${prefix}-muted-fg)`
|
|
790
|
+
},
|
|
791
|
+
skeleton: {
|
|
792
|
+
from: `var(${prefix}-skeleton-from)`,
|
|
793
|
+
to: `var(${prefix}-skeleton-to)`
|
|
794
|
+
},
|
|
795
|
+
shadow: {
|
|
796
|
+
outline: `var(${prefix}-shadow-outline)`,
|
|
797
|
+
umbra: `var(${prefix}-shadow-umbra)`,
|
|
798
|
+
penumbra: `var(${prefix}-shadow-penumbra)`,
|
|
799
|
+
ambient: `var(${prefix}-shadow-ambient)`
|
|
800
|
+
},
|
|
801
|
+
syntax: {
|
|
802
|
+
atrule: `var(${prefix}-syntax-atrule)`,
|
|
803
|
+
attrName: `var(${prefix}-syntax-attrName)`,
|
|
804
|
+
attrValue: `var(${prefix}-syntax-attrValue)`,
|
|
805
|
+
attribute: `var(${prefix}-syntax-attribute)`,
|
|
806
|
+
boolean: `var(${prefix}-syntax-boolean)`,
|
|
807
|
+
builtin: `var(${prefix}-syntax-builtin)`,
|
|
808
|
+
cdata: `var(${prefix}-syntax-cdata)`,
|
|
809
|
+
char: `var(${prefix}-syntax-char)`,
|
|
810
|
+
class: `var(${prefix}-syntax-class)`,
|
|
811
|
+
className: `var(${prefix}-syntax-className)`,
|
|
812
|
+
comment: `var(${prefix}-syntax-comment)`,
|
|
813
|
+
constant: `var(${prefix}-syntax-constant)`,
|
|
814
|
+
deleted: `var(${prefix}-syntax-deleted)`,
|
|
815
|
+
doctype: `var(${prefix}-syntax-doctype)`,
|
|
816
|
+
entity: `var(${prefix}-syntax-entity)`,
|
|
817
|
+
function: `var(${prefix}-syntax-function)`,
|
|
818
|
+
hexcode: `var(${prefix}-syntax-hexcode)`,
|
|
819
|
+
id: `var(${prefix}-syntax-id)`,
|
|
820
|
+
important: `var(${prefix}-syntax-important)`,
|
|
821
|
+
inserted: `var(${prefix}-syntax-inserted)`,
|
|
822
|
+
keyword: `var(${prefix}-syntax-keyword)`,
|
|
823
|
+
number: `var(${prefix}-syntax-number)`,
|
|
824
|
+
operator: `var(${prefix}-syntax-operator)`,
|
|
825
|
+
prolog: `var(${prefix}-syntax-prolog)`,
|
|
826
|
+
property: `var(${prefix}-syntax-property)`,
|
|
827
|
+
pseudoClass: `var(${prefix}-syntax-pseudoClass)`,
|
|
828
|
+
pseudoElement: `var(${prefix}-syntax-pseudoElement)`,
|
|
829
|
+
punctuation: `var(${prefix}-syntax-punctuation)`,
|
|
830
|
+
regex: `var(${prefix}-syntax-regex)`,
|
|
831
|
+
selector: `var(${prefix}-syntax-selector)`,
|
|
832
|
+
string: `var(${prefix}-syntax-string)`,
|
|
833
|
+
symbol: `var(${prefix}-syntax-symbol)`,
|
|
834
|
+
tag: `var(${prefix}-syntax-tag)`,
|
|
835
|
+
unit: `var(${prefix}-syntax-unit)`,
|
|
836
|
+
url: `var(${prefix}-syntax-url)`,
|
|
837
|
+
variable: `var(${prefix}-syntax-variable)`
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
function buildColorInputStateVars(props) {
|
|
842
|
+
const { mode, scheme, state, tone } = props, prefix = `--color-${scheme}-${tone}-input-${mode}-${state}`;
|
|
843
|
+
return {
|
|
844
|
+
bg: `var(${prefix}-bg)`,
|
|
845
|
+
border: `var(${prefix}-border)`,
|
|
846
|
+
fg: `var(${prefix}-fg)`,
|
|
847
|
+
muted: {
|
|
848
|
+
bg: `var(${prefix}-muted-bg)`
|
|
849
|
+
},
|
|
850
|
+
placeholder: `var(${prefix}-placeholder)`
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
const badgeRules = {
|
|
854
|
+
badge: {
|
|
855
|
+
backgroundColor: vars.color.badge.bg,
|
|
856
|
+
color: vars.color.badge.fg,
|
|
857
|
+
verticalAlign: "top"
|
|
858
|
+
},
|
|
859
|
+
...theme.THEME_COLOR_STATE_TONES.reduce(
|
|
860
|
+
(acc, tone) => ({
|
|
861
|
+
...acc,
|
|
862
|
+
[`badge-${tone}`]: {
|
|
863
|
+
[varNames.color.badge.bg]: vars.color.badge[tone].bg,
|
|
864
|
+
[varNames.color.badge.dot]: vars.color.badge[tone].dot,
|
|
865
|
+
[varNames.color.badge.fg]: vars.color.badge[tone].fg,
|
|
866
|
+
[varNames.color.badge.icon]: vars.color.badge[tone].icon
|
|
867
|
+
}
|
|
868
|
+
}),
|
|
869
|
+
{}
|
|
870
|
+
)
|
|
871
|
+
}, boxRules = {
|
|
872
|
+
box: {
|
|
873
|
+
minWidth: 0,
|
|
874
|
+
minHeight: 0,
|
|
875
|
+
"@nest": {
|
|
876
|
+
// 'ul.&, ol.&': {
|
|
877
|
+
'&[data-as="ul"], &[data-as="ol"]': {
|
|
878
|
+
listStyle: "none"
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
},
|
|
882
|
+
// sizing
|
|
883
|
+
"box-content": {
|
|
884
|
+
boxSizing: "content-box"
|
|
885
|
+
},
|
|
886
|
+
"box-border": {
|
|
887
|
+
boxSizing: "border-box"
|
|
888
|
+
}
|
|
889
|
+
}, buttonRules = {
|
|
890
|
+
button: {
|
|
891
|
+
WebkitFontSmoothing: "inherit",
|
|
892
|
+
appearance: "none",
|
|
893
|
+
display: "inline-flex",
|
|
894
|
+
alignItems: "center",
|
|
895
|
+
font: "inherit",
|
|
896
|
+
outline: "none",
|
|
897
|
+
userSelect: "none",
|
|
898
|
+
textDecoration: "none",
|
|
899
|
+
border: 0,
|
|
900
|
+
boxSizing: "border-box",
|
|
901
|
+
padding: 0,
|
|
902
|
+
overflow: "hidden",
|
|
903
|
+
margin: 0,
|
|
904
|
+
textAlign: "left",
|
|
905
|
+
position: "relative",
|
|
906
|
+
verticalAlign: "top",
|
|
907
|
+
backgroundColor: "var(--card-bg-color)",
|
|
908
|
+
color: "var(--card-fg-color)"
|
|
909
|
+
},
|
|
910
|
+
// variants
|
|
911
|
+
...theme.THEME_COLOR_BUTTON_MODES.reduce((acc, mode) => ({
|
|
912
|
+
...acc,
|
|
913
|
+
[`button-mode-${mode}`]: {
|
|
914
|
+
"@nest": theme.THEME_COLOR_STATE_TONES.reduce((acc2, tone) => ({
|
|
915
|
+
...acc2,
|
|
916
|
+
[`&.button-tone-${tone}`]: {
|
|
917
|
+
"--card-bg-color": `var(--card-button-${mode}-${tone}-enabled-bg-color, rgba(127, 127, 127, 0.1))`,
|
|
918
|
+
"--card-fg-color": `var(--card-button-${mode}-${tone}-enabled-fg-color, currentColor)`
|
|
919
|
+
}
|
|
920
|
+
}), {})
|
|
921
|
+
}
|
|
922
|
+
}), {}),
|
|
923
|
+
"button-loading-box": {
|
|
924
|
+
position: "absolute",
|
|
925
|
+
top: 0,
|
|
926
|
+
left: 0,
|
|
927
|
+
right: 0,
|
|
928
|
+
bottom: 0,
|
|
929
|
+
// display: 'flex',
|
|
930
|
+
// alignItems: 'center',
|
|
931
|
+
// justifyContent: 'center',
|
|
932
|
+
backgroundColor: "var(--card-bg-color)",
|
|
933
|
+
borderRadius: "inherit",
|
|
934
|
+
zIndex: 1
|
|
935
|
+
// boxShadow: 'inherit',
|
|
936
|
+
}
|
|
937
|
+
}, cardRules = {
|
|
938
|
+
card: {
|
|
939
|
+
backgroundColor: "var(--card-bg-color)",
|
|
940
|
+
color: "var(--card-fg-color)",
|
|
941
|
+
/* deprecated variables (kept for legacy) */
|
|
942
|
+
"--card-accent-fg-color": "var(--color-accent-fg)",
|
|
943
|
+
...theme.THEME_COLOR_AVATAR_COLORS.reduce((acc, color) => ({
|
|
944
|
+
...acc,
|
|
945
|
+
[`--card-avatar-${color}-bg-color`]: `var(--color-avatar-${color}-bg)`,
|
|
946
|
+
[`--card-avatar-${color}-fg-color`]: `var(--color-avatar-${color}-fg)`
|
|
947
|
+
}), {}),
|
|
948
|
+
"--card-backdrop-color": "var(--color-backdrop)",
|
|
949
|
+
...theme.THEME_COLOR_STATE_TONES.reduce((acc, tone) => ({
|
|
950
|
+
...acc,
|
|
951
|
+
[`--card-badge-${tone}-bg-color`]: `var(--color-badge-${tone}-bg)`,
|
|
952
|
+
[`--card-badge-${tone}-dot-color`]: `var(--color-badge-${tone}-dot)`,
|
|
953
|
+
[`--card-badge-${tone}-fg-color`]: `var(--color-badge-${tone}-fg)`,
|
|
954
|
+
[`--card-badge-${tone}-icon-color`]: `var(--color-badge-${tone}-icon)`
|
|
955
|
+
}), {}),
|
|
956
|
+
"--card-bg-color": "var(--color-bg)",
|
|
957
|
+
"--card-border-color": "var(--color-border)",
|
|
958
|
+
"--card-code-bg-color": "var(--color-code-bg)",
|
|
959
|
+
"--card-code-fg-color": "var(--color-code-fg)",
|
|
960
|
+
"--card-fg-color": "var(--color-fg)",
|
|
961
|
+
"--card-focus-ring-color": "var(--color-focus-ring)",
|
|
962
|
+
"--card-icon-color": "var(--color-icon)",
|
|
963
|
+
"--card-kbd-bg-color": "var(--color-kbd-bg)",
|
|
964
|
+
"--card-kbd-border-color": "var(--color-kbd-border)",
|
|
965
|
+
"--card-kbd-fg-color": "var(--color-kbd-fg)",
|
|
966
|
+
"--card-link-fg-color": "var(--color-link-fg)",
|
|
967
|
+
"--card-muted-bg-color": "var(--color-muted-bg)",
|
|
968
|
+
"--card-muted-fg-color": "var(--color-muted-fg)",
|
|
969
|
+
"--card-shadow-outline-color": "var(--color-shadow-outline)",
|
|
970
|
+
"--card-shadow-umbra-color": "var(--color-shadow-umbra)",
|
|
971
|
+
"--card-shadow-penumbra-color": "var(--color-shadow-penumbra)",
|
|
972
|
+
"--card-shadow-ambient-color": "var(--color-shadow-ambient)",
|
|
973
|
+
"--card-skeleton-from-color": "var(--color-skeleton-from)",
|
|
974
|
+
"--card-skeleton-to-color": "var(--color-skeleton-to)",
|
|
975
|
+
/*
|
|
976
|
+
'--card-bg-image': checkered
|
|
977
|
+
? `repeating-conic-gradient(${color.bg} 0% 25%, ${color.muted.bg} 0% 50%)`
|
|
978
|
+
: undefined,
|
|
979
|
+
|
|
980
|
+
'--card-bg-image': checkered
|
|
981
|
+
? `repeating-conic-gradient(${color.bg} 0% 25%, ${color.muted.bg} 0% 50%)`
|
|
982
|
+
: undefined,
|
|
983
|
+
|
|
984
|
+
'--card-bg2-color': color.muted.bg,
|
|
985
|
+
'--card-link-color': color.link.fg,
|
|
986
|
+
'--card-hairline-soft-color': color.border,
|
|
987
|
+
'--card-hairline-hard-color': color.border, */
|
|
988
|
+
"@nest": {
|
|
989
|
+
'&[data-as="button"]': {
|
|
990
|
+
WebkitFontSmoothing: "inherit",
|
|
991
|
+
appearance: "none",
|
|
992
|
+
outline: "none",
|
|
993
|
+
font: "inherit",
|
|
994
|
+
textAlign: "inherit",
|
|
995
|
+
border: 0,
|
|
996
|
+
width: ["-moz-available", "-webkit-fill-available", "stretch"]
|
|
997
|
+
},
|
|
998
|
+
'&[data-as="a"]': {
|
|
999
|
+
outline: "none",
|
|
1000
|
+
textDecoration: "none"
|
|
1001
|
+
},
|
|
1002
|
+
'&[data-as="pre"]': {
|
|
1003
|
+
font: "inherit"
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
}, checkboxRules = {
|
|
1008
|
+
checkbox: {
|
|
1009
|
+
position: "relative",
|
|
1010
|
+
display: "inline-block"
|
|
1011
|
+
},
|
|
1012
|
+
"checkbox-input": {
|
|
1013
|
+
position: "absolute",
|
|
1014
|
+
top: 0,
|
|
1015
|
+
left: 0,
|
|
1016
|
+
width: "100%",
|
|
1017
|
+
height: "100%",
|
|
1018
|
+
outline: "none",
|
|
1019
|
+
opacity: 0,
|
|
1020
|
+
zIndex: 1,
|
|
1021
|
+
padding: 0,
|
|
1022
|
+
margin: 0,
|
|
1023
|
+
"@nest": {
|
|
1024
|
+
"& + span": {
|
|
1025
|
+
position: "relative",
|
|
1026
|
+
display: "block",
|
|
1027
|
+
width: "var(--input-checkbox-size)",
|
|
1028
|
+
height: "var(--input-checkbox-size)",
|
|
1029
|
+
boxSizing: "border-box",
|
|
1030
|
+
borderRadius: "var(--radius-2)",
|
|
1031
|
+
lineHeight: 1,
|
|
1032
|
+
backgroundColor: "var(--color-checkbox-bg)",
|
|
1033
|
+
boxShadow: "inset 0 0 0 1px var(--color-checkbox-border)",
|
|
1034
|
+
color: "var(--color-checkbox-fg)",
|
|
1035
|
+
"--color-checkbox-bg": "var(--color-input-default-enabled-bg)",
|
|
1036
|
+
"--color-checkbox-border": "var(--color-input-default-enabled-border)",
|
|
1037
|
+
"--color-checkbox-fg": "var(--color-input-default-enabled-fg)"
|
|
1038
|
+
// box-shadow: ${focusRingBorderStyle({
|
|
1039
|
+
// color: color.input.default.enabled.border,
|
|
1040
|
+
// width: input.border.width,
|
|
1041
|
+
// })},
|
|
1042
|
+
},
|
|
1043
|
+
"& + span > svg": {
|
|
1044
|
+
display: "block",
|
|
1045
|
+
position: "absolute",
|
|
1046
|
+
opacity: 0,
|
|
1047
|
+
height: "100%",
|
|
1048
|
+
width: "100%"
|
|
1049
|
+
},
|
|
1050
|
+
"& + span > svg > path": {
|
|
1051
|
+
vectorEffect: "non-scaling-stroke",
|
|
1052
|
+
strokeWidth: "1.5px !important"
|
|
1053
|
+
},
|
|
1054
|
+
"&:checked + span": {
|
|
1055
|
+
"--color-checkbox-bg": "var(--color-input-default-enabled-fg)",
|
|
1056
|
+
"--color-checkbox-border": "var(--color-input-default-enabled-fg)",
|
|
1057
|
+
"--color-checkbox-fg": "var(--color-input-default-enabled-bg)"
|
|
1058
|
+
// box-shadow: ${focusRingBorderStyle({
|
|
1059
|
+
// color: color.input.default.enabled.fg,
|
|
1060
|
+
// width: input.border.width,
|
|
1061
|
+
// })},
|
|
1062
|
+
},
|
|
1063
|
+
"&:checked + span > svg:first-child": {
|
|
1064
|
+
opacity: 1
|
|
1065
|
+
},
|
|
1066
|
+
// focus
|
|
1067
|
+
"&:not(:disabled):focus:focus-visible + span": {
|
|
1068
|
+
// box-shadow: ${focusRingStyle({focusRing})},
|
|
1069
|
+
},
|
|
1070
|
+
// focus when checked - uses a different offset
|
|
1071
|
+
"&:not(:disabled):focus:focus-visible&:checked + span": {
|
|
1072
|
+
// box-shadow: ${focusRingStyle({focusRing: {width: 1, offset: 1}})},
|
|
1073
|
+
},
|
|
1074
|
+
"&[data-error] + span": {
|
|
1075
|
+
"--color-checkbox-bg": "var(--color-input-invalid-enabled-border)",
|
|
1076
|
+
"--color-checkbox-border": "var(--color-input-invalid-enabled-bg)",
|
|
1077
|
+
"--color-checkbox-fg": "var(--color-input-invalid-enabled-fg)"
|
|
1078
|
+
// box-shadow: ${focusRingBorderStyle({
|
|
1079
|
+
// width: input.border.width,
|
|
1080
|
+
// color: color.input.invalid.enabled.muted.bg,
|
|
1081
|
+
// })},
|
|
1082
|
+
},
|
|
1083
|
+
"&[data-error]:checked + span": {
|
|
1084
|
+
"--color-checkbox-bg": "var(--color-input-invalid-enabled-muted-bg)",
|
|
1085
|
+
"--color-checkbox-fg": "var(--color-input-invalid-enabled-bg)"
|
|
1086
|
+
},
|
|
1087
|
+
"&[data-error]:checked:not(:disabled):focus:focus-visible + span": {
|
|
1088
|
+
"--color-checkbox-border": "var(--color-input-invalid-readOnly-muted-bg)"
|
|
1089
|
+
// box-shadow: ${focusRingStyle({
|
|
1090
|
+
// border: {width: input.border.width, color: color.input.invalid.readOnly.muted.bg},
|
|
1091
|
+
// focusRing: {width: 1, offset: 1},
|
|
1092
|
+
// })},
|
|
1093
|
+
},
|
|
1094
|
+
"&:disabled + span": {
|
|
1095
|
+
"--color-checkbox-bg": "var(--color-input-default-disabled-bg)",
|
|
1096
|
+
"--color-checkbox-border": "var(--color-input-default-disabled-border)",
|
|
1097
|
+
"--color-checkbox-fg": "var(--color-input-default-disabled-fg)"
|
|
1098
|
+
// box-shadow: ${focusRingBorderStyle({
|
|
1099
|
+
// width: input.border.width,
|
|
1100
|
+
// color: color.input.default.disabled.border,
|
|
1101
|
+
// })},
|
|
1102
|
+
},
|
|
1103
|
+
"&:disabled:checked + span": {
|
|
1104
|
+
"--color-checkbox-bg": "var(--color-input-default-disabled-muted-bg)"
|
|
1105
|
+
},
|
|
1106
|
+
"&[data-read-only] + span": {
|
|
1107
|
+
"--color-checkbox-bg": "var(--color-input-default-readOnly-bg)",
|
|
1108
|
+
"--color-checkbox-border": "var(--color-input-default-readOnly-border)",
|
|
1109
|
+
"--color-checkbox-fg": "var(--color-input-default-readOnly-fg)"
|
|
1110
|
+
// box-shadow: ${focusRingBorderStyle({
|
|
1111
|
+
// width: input.border.width,
|
|
1112
|
+
// color: color.input.default.readOnly.border,
|
|
1113
|
+
// })},
|
|
1114
|
+
},
|
|
1115
|
+
"&[data-read-only]:checked + span": {
|
|
1116
|
+
"--color-checkbox-bg": "var(--color-input-default-readOnly-muted-bg)"
|
|
1117
|
+
},
|
|
1118
|
+
"&:indeterminate + span > svg:last-child": {
|
|
1119
|
+
opacity: 1
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
}, codeRules = {
|
|
1124
|
+
code: {
|
|
1125
|
+
"--font-weight-regular": "var(--font-code-weight-regular)",
|
|
1126
|
+
"--font-weight-medium": "var(--font-code-weight-medium)",
|
|
1127
|
+
"--font-weight-semibold": "var(--font-code-weight-semibold)",
|
|
1128
|
+
"--font-weight-bold": "var(--font-code-weight-bold)",
|
|
1129
|
+
"--font-family": "var(--font-code-family)",
|
|
1130
|
+
color: "var(--color-fg)",
|
|
1131
|
+
"@nest": {
|
|
1132
|
+
"& > code": {
|
|
1133
|
+
font: "inherit"
|
|
1134
|
+
},
|
|
1135
|
+
"& a": {
|
|
1136
|
+
color: "var(--color-link-fg)",
|
|
1137
|
+
textDecoration: "none"
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
},
|
|
1141
|
+
...responsiveRules("code-0", {
|
|
1142
|
+
"--font-size": "var(--font-code-0-size)",
|
|
1143
|
+
"--font-line-height": "var(--font-code-0-line-height)",
|
|
1144
|
+
"--font-letter-spacing": "var(--font-code-0-letter-spacing)",
|
|
1145
|
+
"--font-icon-size": "var(--font-code-0-icon-size)",
|
|
1146
|
+
"--font-ascender-height": "var(--font-code-0-ascender-height)",
|
|
1147
|
+
"--font-descender-height": "var(--font-code-0-descender-height)"
|
|
1148
|
+
}),
|
|
1149
|
+
...responsiveRules("code-1", {
|
|
1150
|
+
"--font-size": "var(--font-code-1-size)",
|
|
1151
|
+
"--font-line-height": "var(--font-code-1-line-height)",
|
|
1152
|
+
"--font-letter-spacing": "var(--font-code-1-letter-spacing)",
|
|
1153
|
+
"--font-icon-size": "var(--font-code-1-icon-size)",
|
|
1154
|
+
"--font-ascender-height": "var(--font-code-1-ascender-height)",
|
|
1155
|
+
"--font-descender-height": "var(--font-code-1-descender-height)"
|
|
1156
|
+
}),
|
|
1157
|
+
...responsiveRules("code-2", {
|
|
1158
|
+
"--font-size": "var(--font-code-2-size)",
|
|
1159
|
+
"--font-line-height": "var(--font-code-2-line-height)",
|
|
1160
|
+
"--font-letter-spacing": "var(--font-code-2-letter-spacing)",
|
|
1161
|
+
"--font-icon-size": "var(--font-code-2-icon-size)",
|
|
1162
|
+
"--font-ascender-height": "var(--font-code-2-ascender-height)",
|
|
1163
|
+
"--font-descender-height": "var(--font-code-2-descender-height)"
|
|
1164
|
+
}),
|
|
1165
|
+
...responsiveRules("code-3", {
|
|
1166
|
+
"--font-size": "var(--font-code-3-size)",
|
|
1167
|
+
"--font-line-height": "var(--font-code-3-line-height)",
|
|
1168
|
+
"--font-letter-spacing": "var(--font-code-3-letter-spacing)",
|
|
1169
|
+
"--font-icon-size": "var(--font-code-3-icon-size)",
|
|
1170
|
+
"--font-ascender-height": "var(--font-code-3-ascender-height)",
|
|
1171
|
+
"--font-descender-height": "var(--font-code-3-descender-height)"
|
|
1172
|
+
}),
|
|
1173
|
+
...responsiveRules("code-4", {
|
|
1174
|
+
"--font-size": "var(--font-code-4-size)",
|
|
1175
|
+
"--font-line-height": "var(--font-code-4-line-height)",
|
|
1176
|
+
"--font-letter-spacing": "var(--font-code-4-letter-spacing)",
|
|
1177
|
+
"--font-icon-size": "var(--font-code-4-icon-size)",
|
|
1178
|
+
"--font-ascender-height": "var(--font-code-4-ascender-height)",
|
|
1179
|
+
"--font-descender-height": "var(--font-code-4-descender-height)"
|
|
1180
|
+
})
|
|
1181
|
+
}, containerRules = {
|
|
1182
|
+
container: {
|
|
1183
|
+
margin: "0 auto",
|
|
1184
|
+
width: "100%"
|
|
1185
|
+
}
|
|
1186
|
+
}, headingRules = {
|
|
1187
|
+
heading: {
|
|
1188
|
+
"--font-weight-regular": "var(--font-heading-weight-regular)",
|
|
1189
|
+
"--font-weight-medium": "var(--font-heading-weight-medium)",
|
|
1190
|
+
"--font-weight-semibold": "var(--font-heading-weight-semibold)",
|
|
1191
|
+
"--font-weight-bold": "var(--font-heading-weight-bold)",
|
|
1192
|
+
"--font-family": "var(--font-heading-family)",
|
|
1193
|
+
color: "var(--color-fg)",
|
|
1194
|
+
"@nest": {
|
|
1195
|
+
"& a": {
|
|
1196
|
+
color: "var(--color-link-fg)",
|
|
1197
|
+
textDecoration: "none"
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
},
|
|
1201
|
+
"heading-accent": {
|
|
1202
|
+
"--fg-color": "var(--color-accent-fg)"
|
|
1203
|
+
},
|
|
1204
|
+
"heading-muted": {
|
|
1205
|
+
"--fg-color": "var(--color-muted-fg)"
|
|
1206
|
+
},
|
|
1207
|
+
...responsiveRules("heading-0", {
|
|
1208
|
+
"--font-size": "var(--font-heading-0-size)",
|
|
1209
|
+
"--font-line-height": "var(--font-heading-0-line-height)",
|
|
1210
|
+
"--font-letter-spacing": "var(--font-heading-0-letter-spacing)",
|
|
1211
|
+
"--font-icon-size": "var(--font-heading-0-icon-size)",
|
|
1212
|
+
"--font-ascender-height": "var(--font-heading-0-ascender-height)",
|
|
1213
|
+
"--font-descender-height": "var(--font-heading-0-descender-height)"
|
|
1214
|
+
}),
|
|
1215
|
+
...responsiveRules("heading-1", {
|
|
1216
|
+
"--font-size": "var(--font-heading-1-size)",
|
|
1217
|
+
"--font-line-height": "var(--font-heading-1-line-height)",
|
|
1218
|
+
"--font-letter-spacing": "var(--font-heading-1-letter-spacing)",
|
|
1219
|
+
"--font-icon-size": "var(--font-heading-1-icon-size)",
|
|
1220
|
+
"--font-ascender-height": "var(--font-heading-1-ascender-height)",
|
|
1221
|
+
"--font-descender-height": "var(--font-heading-1-descender-height)"
|
|
1222
|
+
}),
|
|
1223
|
+
...responsiveRules("heading-2", {
|
|
1224
|
+
"--font-size": "var(--font-heading-2-size)",
|
|
1225
|
+
"--font-line-height": "var(--font-heading-2-line-height)",
|
|
1226
|
+
"--font-letter-spacing": "var(--font-heading-2-letter-spacing)",
|
|
1227
|
+
"--font-icon-size": "var(--font-heading-2-icon-size)",
|
|
1228
|
+
"--font-ascender-height": "var(--font-heading-2-ascender-height)",
|
|
1229
|
+
"--font-descender-height": "var(--font-heading-2-descender-height)"
|
|
1230
|
+
}),
|
|
1231
|
+
...responsiveRules("heading-3", {
|
|
1232
|
+
"--font-size": "var(--font-heading-3-size)",
|
|
1233
|
+
"--font-line-height": "var(--font-heading-3-line-height)",
|
|
1234
|
+
"--font-letter-spacing": "var(--font-heading-3-letter-spacing)",
|
|
1235
|
+
"--font-icon-size": "var(--font-heading-3-icon-size)",
|
|
1236
|
+
"--font-ascender-height": "var(--font-label-3-ascender-height)",
|
|
1237
|
+
"--font-descender-height": "var(--font-label-3-descender-height)"
|
|
1238
|
+
}),
|
|
1239
|
+
...responsiveRules("heading-4", {
|
|
1240
|
+
"--font-size": "var(--font-heading-4-size)",
|
|
1241
|
+
"--font-line-height": "var(--font-heading-4-line-height)",
|
|
1242
|
+
"--font-letter-spacing": "var(--font-heading-4-letter-spacing)",
|
|
1243
|
+
"--font-icon-size": "var(--font-heading-4-icon-size)",
|
|
1244
|
+
"--font-ascender-height": "var(--font-heading-4-ascender-height)",
|
|
1245
|
+
"--font-descender-height": "var(--font-heading-4-descender-height)"
|
|
1246
|
+
}),
|
|
1247
|
+
...responsiveRules("heading-5", {
|
|
1248
|
+
"--font-size": "var(--font-heading-5-size)",
|
|
1249
|
+
"--font-line-height": "var(--font-heading-5-line-height)",
|
|
1250
|
+
"--font-letter-spacing": "var(--font-heading-5-letter-spacing)",
|
|
1251
|
+
"--font-icon-size": "var(--font-heading-5-icon-size)",
|
|
1252
|
+
"--font-ascender-height": "var(--font-heading-5-ascender-height)",
|
|
1253
|
+
"--font-descender-height": "var(--font-heading-5-descender-height)"
|
|
1254
|
+
})
|
|
1255
|
+
}, kbdRules = {
|
|
1256
|
+
kbd: {
|
|
1257
|
+
"--card-bg-color": "var(--card-kbd-bg-color)",
|
|
1258
|
+
"--card-border-color": "var(--card-kbd-border-color)",
|
|
1259
|
+
"--card-fg-color": "var(--card-kbd-fg-color)",
|
|
1260
|
+
boxShadow: "inset 0 0 0 1px var(--card-border-color)",
|
|
1261
|
+
background: "var(--card-bg-color)",
|
|
1262
|
+
font: "inherit",
|
|
1263
|
+
verticalAlign: "top",
|
|
1264
|
+
"@nest": {
|
|
1265
|
+
"&:not([hidden])": {
|
|
1266
|
+
display: "inline-block"
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
}, labelRules = {
|
|
1271
|
+
label: {
|
|
1272
|
+
"--font-weight-regular": "var(--font-label-weight-regular)",
|
|
1273
|
+
"--font-weight-medium": "var(--font-label-weight-medium)",
|
|
1274
|
+
"--font-weight-semibold": "var(--font-label-weight-semibold)",
|
|
1275
|
+
"--font-weight-bold": "var(--font-label-weight-bold)",
|
|
1276
|
+
"--font-family": "var(--font-label-family)",
|
|
1277
|
+
color: "var(--color-fg)",
|
|
1278
|
+
textTransform: "uppercase",
|
|
1279
|
+
"@nest": {
|
|
1280
|
+
"& a": {
|
|
1281
|
+
color: "var(--color-link-fg)",
|
|
1282
|
+
textDecoration: "none"
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
},
|
|
1286
|
+
"label-accent": {
|
|
1287
|
+
"--fg-color": "var(--color-accent-fg)"
|
|
1288
|
+
},
|
|
1289
|
+
"label-muted": {
|
|
1290
|
+
"--fg-color": "var(--color-muted-fg)"
|
|
1291
|
+
},
|
|
1292
|
+
...responsiveRules("label-0", {
|
|
1293
|
+
"--font-size": "var(--font-label-0-size)",
|
|
1294
|
+
"--font-line-height": "var(--font-label-0-line-height)",
|
|
1295
|
+
"--font-letter-spacing": "var(--font-label-0-letter-spacing)",
|
|
1296
|
+
"--font-icon-size": "var(--font-label-0-icon-size)",
|
|
1297
|
+
"--font-ascender-height": "var(--font-label-0-ascender-height)",
|
|
1298
|
+
"--font-descender-height": "var(--font-label-0-descender-height)"
|
|
1299
|
+
}),
|
|
1300
|
+
...responsiveRules("label-1", {
|
|
1301
|
+
"--font-size": "var(--font-label-1-size)",
|
|
1302
|
+
"--font-line-height": "var(--font-label-1-line-height)",
|
|
1303
|
+
"--font-letter-spacing": "var(--font-label-1-letter-spacing)",
|
|
1304
|
+
"--font-icon-size": "var(--font-label-1-icon-size)",
|
|
1305
|
+
"--font-ascender-height": "var(--font-label-1-ascender-height)",
|
|
1306
|
+
"--font-descender-height": "var(--font-label-1-descender-height)"
|
|
1307
|
+
}),
|
|
1308
|
+
...responsiveRules("label-2", {
|
|
1309
|
+
"--font-size": "var(--font-label-2-size)",
|
|
1310
|
+
"--font-line-height": "var(--font-label-2-line-height)",
|
|
1311
|
+
"--font-letter-spacing": "var(--font-label-2-letter-spacing)",
|
|
1312
|
+
"--font-icon-size": "var(--font-label-2-icon-size)",
|
|
1313
|
+
"--font-ascender-height": "var(--font-label-2-ascender-height)",
|
|
1314
|
+
"--font-descender-height": "var(--font-label-2-descender-height)"
|
|
1315
|
+
}),
|
|
1316
|
+
...responsiveRules("label-3", {
|
|
1317
|
+
"--font-size": "var(--font-label-3-size)",
|
|
1318
|
+
"--font-line-height": "var(--font-label-3-line-height)",
|
|
1319
|
+
"--font-letter-spacing": "var(--font-label-3-letter-spacing)",
|
|
1320
|
+
"--font-icon-size": "var(--font-label-3-icon-size)",
|
|
1321
|
+
"--font-ascender-height": "var(--font-label-3-ascender-height)",
|
|
1322
|
+
"--font-descender-height": "var(--font-label-3-descender-height)"
|
|
1323
|
+
}),
|
|
1324
|
+
...responsiveRules("label-4", {
|
|
1325
|
+
"--font-size": "var(--font-label-4-size)",
|
|
1326
|
+
"--font-line-height": "var(--font-label-4-line-height)",
|
|
1327
|
+
"--font-letter-spacing": "var(--font-label-4-letter-spacing)",
|
|
1328
|
+
"--font-icon-size": "var(--font-label-4-icon-size)",
|
|
1329
|
+
"--font-ascender-height": "var(--font-label-4-ascender-height)",
|
|
1330
|
+
"--font-descender-height": "var(--font-label-4-descender-height)"
|
|
1331
|
+
}),
|
|
1332
|
+
...responsiveRules("label-5", {
|
|
1333
|
+
"--font-size": "var(--font-label-5-size)",
|
|
1334
|
+
"--font-line-height": "var(--font-label-5-line-height)",
|
|
1335
|
+
"--font-letter-spacing": "var(--font-label-5-letter-spacing)",
|
|
1336
|
+
"--font-icon-size": "var(--font-label-5-icon-size)",
|
|
1337
|
+
"--font-ascender-height": "var(--font-label-5-ascender-height)",
|
|
1338
|
+
"--font-descender-height": "var(--font-label-5-descender-height)"
|
|
1339
|
+
})
|
|
1340
|
+
}, popoverRules = {
|
|
1341
|
+
//
|
|
1342
|
+
}, radioRules = {
|
|
1343
|
+
//
|
|
1344
|
+
}, selectRules = {
|
|
1345
|
+
//
|
|
1346
|
+
}, selectableRules = {
|
|
1347
|
+
selectable: {
|
|
1348
|
+
backgroundColor: "inherit",
|
|
1349
|
+
color: "inherit",
|
|
1350
|
+
"@nest": {
|
|
1351
|
+
'&[data-as="button"]': {
|
|
1352
|
+
WebkitFontSmoothing: "inherit",
|
|
1353
|
+
appearance: "none",
|
|
1354
|
+
outline: "none",
|
|
1355
|
+
font: "inherit",
|
|
1356
|
+
textAlign: "inherit",
|
|
1357
|
+
border: 0,
|
|
1358
|
+
// width: '-moz-available',
|
|
1359
|
+
// width: '-webkit-fill-available',
|
|
1360
|
+
width: "stretch"
|
|
1361
|
+
},
|
|
1362
|
+
/* &:is(a) */
|
|
1363
|
+
'&[data-as="a"]': {
|
|
1364
|
+
textDecoration: "none"
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
}, spinnerRules = {
|
|
1369
|
+
spinner: {
|
|
1370
|
+
"@keyframes": {
|
|
1371
|
+
"spinner-rotate": {
|
|
1372
|
+
from: {
|
|
1373
|
+
transform: "rotate(0deg)"
|
|
1374
|
+
},
|
|
1375
|
+
to: {
|
|
1376
|
+
transform: "rotate(360deg)"
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
},
|
|
1380
|
+
"@nest": {
|
|
1381
|
+
"& > span > svg": {
|
|
1382
|
+
animation: "spinner-rotate 500ms linear infinite"
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
}, switchRules = {
|
|
1387
|
+
switch: {},
|
|
1388
|
+
"switch-input": {
|
|
1389
|
+
position: "absolute",
|
|
1390
|
+
top: 0,
|
|
1391
|
+
right: 0,
|
|
1392
|
+
bottom: 0,
|
|
1393
|
+
left: 0,
|
|
1394
|
+
opacity: 0,
|
|
1395
|
+
height: "100%",
|
|
1396
|
+
width: "100%",
|
|
1397
|
+
outline: "none",
|
|
1398
|
+
padding: 0,
|
|
1399
|
+
margin: 0,
|
|
1400
|
+
/* Place the input element above the representation element */
|
|
1401
|
+
zIndex: 1
|
|
1402
|
+
},
|
|
1403
|
+
"switch-presentation": {
|
|
1404
|
+
// --switch-bg-color: ${color.input.default.enabled.border};
|
|
1405
|
+
// --switch-fg-color: ${color.input.default.enabled.bg};
|
|
1406
|
+
// --switch-box-shadow: none;
|
|
1407
|
+
// &:not([hidden]) {
|
|
1408
|
+
// display: block;
|
|
1409
|
+
// }
|
|
1410
|
+
// position: relative;
|
|
1411
|
+
// width: ${rem(input.switch.width)};
|
|
1412
|
+
// height: ${rem(input.switch.height)};
|
|
1413
|
+
// border-radius: ${rem(input.switch.height / 2)};
|
|
1414
|
+
// /* Make sure it’s not possible to interact with the wrapper element */
|
|
1415
|
+
// pointer-events: none;
|
|
1416
|
+
// &:after {
|
|
1417
|
+
// content: '';
|
|
1418
|
+
// display: block;
|
|
1419
|
+
// position: absolute;
|
|
1420
|
+
// top: 0;
|
|
1421
|
+
// left: 0;
|
|
1422
|
+
// right: 0;
|
|
1423
|
+
// bottom: 0;
|
|
1424
|
+
// z-index: 1;
|
|
1425
|
+
// box-shadow: var(--switch-box-shadow);
|
|
1426
|
+
// border-radius: inherit;
|
|
1427
|
+
// }
|
|
1428
|
+
// /* Focus styles */
|
|
1429
|
+
// input:focus + && {
|
|
1430
|
+
// --switch-box-shadow: ${focusRingStyle({focusRing: input.switch.focusRing})};
|
|
1431
|
+
// }
|
|
1432
|
+
// input:focus:not(:focus-visible) + && {
|
|
1433
|
+
// --switch-box-shadow: none;
|
|
1434
|
+
// }
|
|
1435
|
+
// input:checked + && {
|
|
1436
|
+
// --switch-bg-color: ${color.input.default.enabled.fg};
|
|
1437
|
+
// --switch-fg-color: ${color.input.default.enabled.bg};
|
|
1438
|
+
// }
|
|
1439
|
+
// @media (hover: hover) {
|
|
1440
|
+
// input:not(:disabled):hover + && {
|
|
1441
|
+
// --switch-bg-color: ${color.input.default.hovered.border};
|
|
1442
|
+
// --switch-fg-color: ${color.input.default.hovered.bg};
|
|
1443
|
+
// }
|
|
1444
|
+
// input:not(:disabled):checked:hover + && {
|
|
1445
|
+
// --switch-bg-color: ${color.input.default.enabled.fg};
|
|
1446
|
+
// --switch-fg-color: ${color.input.default.enabled.bg};
|
|
1447
|
+
// }
|
|
1448
|
+
// }
|
|
1449
|
+
// input:not([data-read-only]):disabled + && {
|
|
1450
|
+
// --switch-bg-color: ${color.input.default.disabled.border};
|
|
1451
|
+
// --switch-fg-color: ${color.input.default.disabled.bg};
|
|
1452
|
+
// }
|
|
1453
|
+
// input[data-read-only]:disabled + && {
|
|
1454
|
+
// --switch-bg-color: ${color.input.default.readOnly.border};
|
|
1455
|
+
// --switch-fg-color: ${color.input.default.readOnly.bg};
|
|
1456
|
+
// }
|
|
1457
|
+
// input:checked[data-read-only]:disabled + && {
|
|
1458
|
+
// --switch-bg-color: ${color.input.default.readOnly.fg};
|
|
1459
|
+
// --switch-fg-color: ${color.input.default.readOnly.bg};
|
|
1460
|
+
// }
|
|
1461
|
+
},
|
|
1462
|
+
"switch-track": {
|
|
1463
|
+
// &:not([hidden]) {
|
|
1464
|
+
// display: block;
|
|
1465
|
+
// }
|
|
1466
|
+
// background-color: var(--switch-bg-color);
|
|
1467
|
+
// position: absolute;
|
|
1468
|
+
// left: 0;
|
|
1469
|
+
// top: 0;
|
|
1470
|
+
// width: ${rem(input.switch.width)};
|
|
1471
|
+
// height: ${rem(input.switch.height)};
|
|
1472
|
+
// border-radius: ${rem(input.switch.height / 2)};
|
|
1473
|
+
},
|
|
1474
|
+
"switch-thumb": {
|
|
1475
|
+
// const {$indeterminate} = props
|
|
1476
|
+
// const {input} = getTheme_v2(props.theme)
|
|
1477
|
+
// const trackWidth = input.switch.width
|
|
1478
|
+
// const trackHeight = input.switch.height
|
|
1479
|
+
// const trackPadding = input.switch.padding
|
|
1480
|
+
// const size = trackHeight - input.switch.padding * 2
|
|
1481
|
+
// const checkedOffset = trackWidth - trackPadding * 2 - size
|
|
1482
|
+
// const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding
|
|
1483
|
+
// const checked = $indeterminate !== true && props.$checked === true
|
|
1484
|
+
// return css`
|
|
1485
|
+
// &:not([hidden]) {
|
|
1486
|
+
// display: block;
|
|
1487
|
+
// }
|
|
1488
|
+
// position: absolute;
|
|
1489
|
+
// left: ${rem(trackPadding)};
|
|
1490
|
+
// top: ${rem(trackPadding)};
|
|
1491
|
+
// height: ${rem(size)};
|
|
1492
|
+
// width: ${rem(size)};
|
|
1493
|
+
// border-radius: ${rem(size / 2)};
|
|
1494
|
+
// transition-property: transform;
|
|
1495
|
+
// transition-duration: ${input.switch.transitionDurationMs}ms;
|
|
1496
|
+
// transition-timing-function: ${input.switch.transitionTimingFunction};
|
|
1497
|
+
// background: var(--switch-fg-color);
|
|
1498
|
+
// transform: translate3d(0, 0, 0);
|
|
1499
|
+
// box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.05);
|
|
1500
|
+
// ${checked &&
|
|
1501
|
+
// css`
|
|
1502
|
+
// transform: translate3d(${checkedOffset}px, 0, 0);
|
|
1503
|
+
// `}
|
|
1504
|
+
// ${$indeterminate &&
|
|
1505
|
+
// css`
|
|
1506
|
+
// transform: translate3d(${indeterminateOffset}px, 0, 0);
|
|
1507
|
+
// `}
|
|
1508
|
+
// `
|
|
1509
|
+
}
|
|
1510
|
+
}, textRules = {
|
|
1511
|
+
text: {
|
|
1512
|
+
"--font-weight-regular": "var(--font-text-weight-regular)",
|
|
1513
|
+
"--font-weight-medium": "var(--font-text-weight-medium)",
|
|
1514
|
+
"--font-weight-semibold": "var(--font-text-weight-semibold)",
|
|
1515
|
+
"--font-weight-bold": "var(--font-text-weight-bold)",
|
|
1516
|
+
"--font-family": "var(--font-text-family)",
|
|
1517
|
+
color: "var(--color-fg)",
|
|
1518
|
+
"@nest": {
|
|
1519
|
+
"& a": {
|
|
1520
|
+
color: "var(--color-link-fg)",
|
|
1521
|
+
textDecoration: "none"
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
},
|
|
1525
|
+
"text-accent": {
|
|
1526
|
+
"--fg-color": "var(--color-accent-fg)"
|
|
1527
|
+
},
|
|
1528
|
+
"text-muted": {
|
|
1529
|
+
"--fg-color": "var(--color-muted-fg)"
|
|
1530
|
+
},
|
|
1531
|
+
...responsiveRules("text-0", {
|
|
1532
|
+
"--font-size": "var(--font-text-0-size)",
|
|
1533
|
+
"--font-line-height": "var(--font-text-0-line-height)",
|
|
1534
|
+
"--font-letter-spacing": "var(--font-text-0-letter-spacing)",
|
|
1535
|
+
"--font-icon-size": "var(--font-text-0-icon-size)",
|
|
1536
|
+
"--font-ascender-height": "var(--font-text-0-ascender-height)",
|
|
1537
|
+
"--font-descender-height": "var(--font-text-0-descender-height)"
|
|
1538
|
+
}),
|
|
1539
|
+
...responsiveRules("text-1", {
|
|
1540
|
+
"--font-size": "var(--font-text-1-size)",
|
|
1541
|
+
"--font-line-height": "var(--font-text-1-line-height)",
|
|
1542
|
+
"--font-letter-spacing": "var(--font-text-1-letter-spacing)",
|
|
1543
|
+
"--font-icon-size": "var(--font-text-1-icon-size)",
|
|
1544
|
+
"--font-ascender-height": "var(--font-text-1-ascender-height)",
|
|
1545
|
+
"--font-descender-height": "var(--font-text-1-descender-height)"
|
|
1546
|
+
}),
|
|
1547
|
+
...responsiveRules("text-2", {
|
|
1548
|
+
"--font-size": "var(--font-text-2-size)",
|
|
1549
|
+
"--font-line-height": "var(--font-text-2-line-height)",
|
|
1550
|
+
"--font-letter-spacing": "var(--font-text-2-letter-spacing)",
|
|
1551
|
+
"--font-icon-size": "var(--font-text-2-icon-size)",
|
|
1552
|
+
"--font-ascender-height": "var(--font-text-2-ascender-height)",
|
|
1553
|
+
"--font-descender-height": "var(--font-text-2-descender-height)"
|
|
1554
|
+
}),
|
|
1555
|
+
...responsiveRules("text-3", {
|
|
1556
|
+
"--font-size": "var(--font-text-3-size)",
|
|
1557
|
+
"--font-line-height": "var(--font-text-3-line-height)",
|
|
1558
|
+
"--font-letter-spacing": "var(--font-text-3-letter-spacing)",
|
|
1559
|
+
"--font-icon-size": "var(--font-text-3-icon-size)",
|
|
1560
|
+
"--font-ascender-height": "var(--font-text-3-ascender-height)",
|
|
1561
|
+
"--font-descender-height": "var(--font-text-3-descender-height)"
|
|
1562
|
+
}),
|
|
1563
|
+
...responsiveRules("text-4", {
|
|
1564
|
+
"--font-size": "var(--font-text-4-size)",
|
|
1565
|
+
"--font-line-height": "var(--font-text-4-line-height)",
|
|
1566
|
+
"--font-letter-spacing": "var(--font-text-4-letter-spacing)",
|
|
1567
|
+
"--font-icon-size": "var(--font-text-4-icon-size)",
|
|
1568
|
+
"--font-ascender-height": "var(--font-text-4-ascender-height)",
|
|
1569
|
+
"--font-descender-height": "var(--font-text-4-descender-height)"
|
|
1570
|
+
})
|
|
1571
|
+
}, textAreaRules = {
|
|
1572
|
+
//
|
|
1573
|
+
}, textInputRules = {
|
|
1574
|
+
"text-input": {
|
|
1575
|
+
//
|
|
1576
|
+
},
|
|
1577
|
+
"text-input-wrapper": {
|
|
1578
|
+
"@nest": {
|
|
1579
|
+
"& > input": {
|
|
1580
|
+
appearance: "none",
|
|
1581
|
+
background: "none",
|
|
1582
|
+
border: 0,
|
|
1583
|
+
borderRadius: 0,
|
|
1584
|
+
outline: "none",
|
|
1585
|
+
width: "100%",
|
|
1586
|
+
boxSizing: "border-box",
|
|
1587
|
+
fontFamily: "var(--font-family)",
|
|
1588
|
+
fontSize: "var(--font-size)",
|
|
1589
|
+
/* font-family: ${font.text.family}, */
|
|
1590
|
+
/* font-weight: ${($weight && font.text.weights[$weight]) || font.text.weights.regular}, */
|
|
1591
|
+
margin: 0,
|
|
1592
|
+
position: "relative",
|
|
1593
|
+
zIndex: 1,
|
|
1594
|
+
display: "block",
|
|
1595
|
+
color: "var(--input-fg-color)",
|
|
1596
|
+
"@nest": {
|
|
1597
|
+
// NOTE: This is a hack to disable Chrome’s autofill styles
|
|
1598
|
+
"&:-webkit-autofill, &:-webkit-autofill:hover, &:-webkit-autofill:focus, &:-webkit-autofill:active": {
|
|
1599
|
+
WebkitTextFillColor: "var(--input-fg-color) !important",
|
|
1600
|
+
transition: "background-color 5000s",
|
|
1601
|
+
transitionDelay: "86400s"
|
|
1602
|
+
// 24h
|
|
1603
|
+
}
|
|
1604
|
+
// /* &:is(textarea) */
|
|
1605
|
+
// &[data-as='textarea'] {
|
|
1606
|
+
// resize: none;
|
|
1607
|
+
// }
|
|
1608
|
+
// &::placeholder {
|
|
1609
|
+
// color: var(--input-placeholder-color);
|
|
1610
|
+
// }
|
|
1611
|
+
// &[data-scheme='${$scheme}'][data-tone='${$tone}'] {
|
|
1612
|
+
// /* --input-fg-color: ${color.input.default.enabled.fg}; */
|
|
1613
|
+
// /* --input-placeholder-color: ${color.input.default.enabled.placeholder}; */
|
|
1614
|
+
// /* enabled */
|
|
1615
|
+
// &:not(:invalid):not(:disabled):not(:read-only) {
|
|
1616
|
+
// /* --input-fg-color: ${color.input.default.enabled.fg}; */
|
|
1617
|
+
// /* --input-placeholder-color: ${color.input.default.enabled.placeholder}; */
|
|
1618
|
+
// }
|
|
1619
|
+
// /* disabled */
|
|
1620
|
+
// &:not(:invalid):disabled {
|
|
1621
|
+
// /* --input-fg-color: ${color.input.default.disabled.fg}; */
|
|
1622
|
+
// /* --input-placeholder-color: ${color.input.default.disabled.placeholder}; */
|
|
1623
|
+
// }
|
|
1624
|
+
// /* invalid */
|
|
1625
|
+
// &:invalid {
|
|
1626
|
+
// /* --input-fg-color: ${color.input.invalid.enabled.fg}; */
|
|
1627
|
+
// /* --input-placeholder-color: ${color.input.invalid.enabled.placeholder}; */
|
|
1628
|
+
// }
|
|
1629
|
+
// /* readOnly */
|
|
1630
|
+
// &:read-only {
|
|
1631
|
+
// /* --input-fg-color: ${color.input.default.readOnly.fg}; */
|
|
1632
|
+
// /* --input-placeholder-color: ${color.input.default.readOnly.placeholder}; */
|
|
1633
|
+
// }
|
|
1634
|
+
// }
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
},
|
|
1639
|
+
"text-input-prefix": {
|
|
1640
|
+
borderTopRightRadius: 0,
|
|
1641
|
+
borderBottomRightRadius: 0,
|
|
1642
|
+
"@nest": {
|
|
1643
|
+
"& > span": {
|
|
1644
|
+
display: "block",
|
|
1645
|
+
margin: "-1px"
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
},
|
|
1649
|
+
"text-input-suffix": {
|
|
1650
|
+
borderTopRightRadius: 0,
|
|
1651
|
+
borderBottomRightRadius: 0,
|
|
1652
|
+
"@nest": {
|
|
1653
|
+
"& > span": {
|
|
1654
|
+
display: "block",
|
|
1655
|
+
margin: "-1px"
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
},
|
|
1659
|
+
"text-input-presentation": {
|
|
1660
|
+
"--input-box-shadow": "none",
|
|
1661
|
+
position: "absolute",
|
|
1662
|
+
top: 0,
|
|
1663
|
+
left: 0,
|
|
1664
|
+
right: 0,
|
|
1665
|
+
bottom: 0,
|
|
1666
|
+
display: "block",
|
|
1667
|
+
pointerEvents: "none",
|
|
1668
|
+
zIndex: 0,
|
|
1669
|
+
backgroundColor: "var(--card-bg-color)",
|
|
1670
|
+
boxShadow: "var(--input-box-shadow)"
|
|
1671
|
+
// border-top-left-radius: ${$hasPrefix ? 0 : undefined};
|
|
1672
|
+
// border-bottom-left-radius: ${$hasPrefix ? 0 : undefined};
|
|
1673
|
+
// border-top-right-radius: ${$hasSuffix ? 0 : undefined};
|
|
1674
|
+
// border-bottom-right-radius: ${$hasSuffix ? 0 : undefined};
|
|
1675
|
+
// &[data-scheme='${$scheme}'][data-tone='${$tone}'] {
|
|
1676
|
+
// --card-bg-color: ${color.input.default.enabled.bg};
|
|
1677
|
+
// --card-fg-color: ${color.input.default.enabled.fg};
|
|
1678
|
+
// /* enabled */
|
|
1679
|
+
// *:not(:disabled) + &[data-border] {
|
|
1680
|
+
// --input-box-shadow: ${focusRingBorderStyle({
|
|
1681
|
+
// color: color.input.default.enabled.border,
|
|
1682
|
+
// width: input.border.width,
|
|
1683
|
+
// })};
|
|
1684
|
+
// }
|
|
1685
|
+
// /* invalid */
|
|
1686
|
+
// *:not(:disabled):invalid + & {
|
|
1687
|
+
// --card-bg-color: ${color.input.invalid.enabled.bg};
|
|
1688
|
+
// --card-fg-color: ${color.input.invalid.enabled.fg};
|
|
1689
|
+
// &[data-border] {
|
|
1690
|
+
// --input-box-shadow: ${focusRingBorderStyle({
|
|
1691
|
+
// color: color.input.invalid.enabled.border,
|
|
1692
|
+
// width: input.border.width,
|
|
1693
|
+
// })};
|
|
1694
|
+
// }
|
|
1695
|
+
// }
|
|
1696
|
+
// /* focused */
|
|
1697
|
+
// *:not(:disabled):focus + & {
|
|
1698
|
+
// &[data-border] {
|
|
1699
|
+
// --input-box-shadow: ${$unstableDisableFocusRing
|
|
1700
|
+
// ? undefined
|
|
1701
|
+
// : focusRingStyle({
|
|
1702
|
+
// border: {color: color.input.default.enabled.border, width: input.border.width},
|
|
1703
|
+
// focusRing: input.text.focusRing,
|
|
1704
|
+
// })};
|
|
1705
|
+
// }
|
|
1706
|
+
// &:not([data-border]) {
|
|
1707
|
+
// --input-box-shadow: ${$unstableDisableFocusRing
|
|
1708
|
+
// ? undefined
|
|
1709
|
+
// : focusRingStyle({focusRing: input.text.focusRing})};
|
|
1710
|
+
// }
|
|
1711
|
+
// }
|
|
1712
|
+
// /* disabled */
|
|
1713
|
+
// *:not(:invalid):disabled + & {
|
|
1714
|
+
// --card-bg-color: ${color.input.default.disabled.bg} !important;
|
|
1715
|
+
// --card-fg-color: ${color.input.default.disabled.fg} !important;
|
|
1716
|
+
// --card-icon-color: ${color.input.default.disabled.fg} !important;
|
|
1717
|
+
// &[data-border] {
|
|
1718
|
+
// --input-box-shadow: ${focusRingBorderStyle({
|
|
1719
|
+
// color: color.input.default.disabled.border,
|
|
1720
|
+
// width: input.border.width,
|
|
1721
|
+
// })};
|
|
1722
|
+
// }
|
|
1723
|
+
// }
|
|
1724
|
+
// *:invalid:disabled + & {
|
|
1725
|
+
// --card-bg-color: ${color.input.invalid.disabled.bg} !important;
|
|
1726
|
+
// --card-fg-color: ${color.input.invalid.disabled.fg} !important;
|
|
1727
|
+
// --card-icon-color: ${color.input.invalid.disabled.fg} !important;
|
|
1728
|
+
// &[data-border] {
|
|
1729
|
+
// --input-box-shadow: ${focusRingBorderStyle({
|
|
1730
|
+
// color: color.input.invalid.disabled.border,
|
|
1731
|
+
// width: input.border.width,
|
|
1732
|
+
// })};
|
|
1733
|
+
// }
|
|
1734
|
+
// }
|
|
1735
|
+
// /* readOnly */
|
|
1736
|
+
// *:not(:invalid):read-only + & {
|
|
1737
|
+
// --card-bg-color: ${color.input.default.readOnly.bg} !important;
|
|
1738
|
+
// --card-fg-color: ${color.input.default.readOnly.fg} !important;
|
|
1739
|
+
// }
|
|
1740
|
+
// *:invalid:read-only + & {
|
|
1741
|
+
// --card-bg-color: ${color.input.invalid.readOnly.bg} !important;
|
|
1742
|
+
// --card-fg-color: ${color.input.invalid.readOnly.fg} !important;
|
|
1743
|
+
// }
|
|
1744
|
+
// /* hovered */
|
|
1745
|
+
// @media (hover: hover) {
|
|
1746
|
+
// *:not(:disabled):not(:read-only):not(:invalid):hover + & {
|
|
1747
|
+
// --card-bg-color: ${color.input.default.hovered.bg};
|
|
1748
|
+
// --card-fg-color: ${color.input.default.hovered.fg};
|
|
1749
|
+
// }
|
|
1750
|
+
// *:invalid:not(:disabled):not(:read-only):hover + & {
|
|
1751
|
+
// --card-bg-color: ${color.input.invalid.hovered.bg};
|
|
1752
|
+
// --card-fg-color: ${color.input.invalid.hovered.fg};
|
|
1753
|
+
// }
|
|
1754
|
+
// *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {
|
|
1755
|
+
// --input-box-shadow: ${focusRingBorderStyle({
|
|
1756
|
+
// color: color.input.default.hovered.border,
|
|
1757
|
+
// width: input.border.width,
|
|
1758
|
+
// })};
|
|
1759
|
+
// }
|
|
1760
|
+
// *:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border] {
|
|
1761
|
+
// --input-box-shadow: ${focusRingBorderStyle({
|
|
1762
|
+
// color: color.input.invalid.hovered.border,
|
|
1763
|
+
// width: input.border.width,
|
|
1764
|
+
// })};
|
|
1765
|
+
// }
|
|
1766
|
+
// }
|
|
1767
|
+
// }
|
|
1768
|
+
}
|
|
1769
|
+
}, tokenRules = {
|
|
1770
|
+
token: {
|
|
1771
|
+
"@nest": {
|
|
1772
|
+
"&.atrule": { color: vars.color.syntax.atrule },
|
|
1773
|
+
"&.attr-name": { color: vars.color.syntax.attrName },
|
|
1774
|
+
"&.attr-value": { color: vars.color.syntax.attrValue },
|
|
1775
|
+
"&.attribute": { color: vars.color.syntax.attribute },
|
|
1776
|
+
"&.boolean": { color: vars.color.syntax.boolean },
|
|
1777
|
+
"&.builtin": { color: vars.color.syntax.builtin },
|
|
1778
|
+
"&.cdata": { color: vars.color.syntax.cdata },
|
|
1779
|
+
"&.char": { color: vars.color.syntax.char },
|
|
1780
|
+
"&.class": { color: vars.color.syntax.class },
|
|
1781
|
+
"&.class-name": { color: vars.color.syntax.className },
|
|
1782
|
+
"&.comment": { color: vars.color.syntax.comment },
|
|
1783
|
+
"&.constant": { color: vars.color.syntax.constant },
|
|
1784
|
+
"&.deleted": { color: vars.color.syntax.deleted },
|
|
1785
|
+
"&.doctype": { color: vars.color.syntax.doctype },
|
|
1786
|
+
"&.entity": { color: vars.color.syntax.entity },
|
|
1787
|
+
"&.function": { color: vars.color.syntax.function },
|
|
1788
|
+
"&.hexcode": { color: vars.color.syntax.hexcode },
|
|
1789
|
+
"&.id": { color: vars.color.syntax.id },
|
|
1790
|
+
"&.important": { color: vars.color.syntax.important },
|
|
1791
|
+
"&.inserted": { color: vars.color.syntax.inserted },
|
|
1792
|
+
"&.keyword": { color: vars.color.syntax.keyword },
|
|
1793
|
+
"&.number": { color: vars.color.syntax.number },
|
|
1794
|
+
"&.operator": { color: vars.color.syntax.operator },
|
|
1795
|
+
"&.prolog": { color: vars.color.syntax.prolog },
|
|
1796
|
+
"&.property": { color: vars.color.syntax.property },
|
|
1797
|
+
"&.pseudo-class": { color: vars.color.syntax.pseudoClass },
|
|
1798
|
+
"&.pseudo-element": { color: vars.color.syntax.pseudoElement },
|
|
1799
|
+
"&.punctuation": { color: vars.color.syntax.punctuation },
|
|
1800
|
+
"&.regex": { color: vars.color.syntax.regex },
|
|
1801
|
+
"&.selector": { color: vars.color.syntax.selector },
|
|
1802
|
+
"&.string": { color: vars.color.syntax.string },
|
|
1803
|
+
"&.symbol": { color: vars.color.syntax.symbol },
|
|
1804
|
+
"&.tag": { color: vars.color.syntax.tag },
|
|
1805
|
+
"&.unit": { color: vars.color.syntax.unit },
|
|
1806
|
+
"&.url": { color: vars.color.syntax.url },
|
|
1807
|
+
"&.variable": { color: vars.color.syntax.variable }
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
}, tooltipRules = {
|
|
1811
|
+
tooltip: {
|
|
1812
|
+
pointerEvents: "none"
|
|
1813
|
+
},
|
|
1814
|
+
"tooltip-card": {
|
|
1815
|
+
"@nest": {
|
|
1816
|
+
"&[data-animate] > *": {
|
|
1817
|
+
// opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
|
|
1818
|
+
opacity: "var(--motion-content-opacity, 1)",
|
|
1819
|
+
willChange: "opacity"
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
}, borderRules = {
|
|
1824
|
+
...responsiveRules("border", {
|
|
1825
|
+
border: "1px solid var(--card-border-color)"
|
|
1826
|
+
}),
|
|
1827
|
+
...responsiveRules("border-t", {
|
|
1828
|
+
borderTop: "1px solid var(--card-border-color)"
|
|
1829
|
+
}),
|
|
1830
|
+
...responsiveRules("border-r", {
|
|
1831
|
+
borderRight: "1px solid var(--card-border-color)"
|
|
1832
|
+
}),
|
|
1833
|
+
...responsiveRules("border-b", {
|
|
1834
|
+
borderBottom: "1px solid var(--card-border-color)"
|
|
1835
|
+
}),
|
|
1836
|
+
...responsiveRules("border-l", {
|
|
1837
|
+
borderLeft: "1px solid var(--card-border-color)"
|
|
1838
|
+
})
|
|
1839
|
+
}, displayRules = {
|
|
1840
|
+
...responsiveRules("block", {
|
|
1841
|
+
"@nest": {
|
|
1842
|
+
"&:not([hidden])": {
|
|
1843
|
+
display: "block"
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
}),
|
|
1847
|
+
...responsiveRules("inline-block", {
|
|
1848
|
+
"@nest": {
|
|
1849
|
+
"&:not([hidden])": {
|
|
1850
|
+
display: "inline-block"
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
}),
|
|
1854
|
+
...responsiveRules("flex", {
|
|
1855
|
+
"@nest": {
|
|
1856
|
+
"&:not([hidden])": {
|
|
1857
|
+
display: "flex"
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
}),
|
|
1861
|
+
...responsiveRules("inline-flex", {
|
|
1862
|
+
"@nest": {
|
|
1863
|
+
"&:not([hidden])": {
|
|
1864
|
+
display: "inline-flex"
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
}),
|
|
1868
|
+
...responsiveRules("grid", {
|
|
1869
|
+
gridTemplateRows: "auto",
|
|
1870
|
+
"@nest": {
|
|
1871
|
+
"&:not([hidden])": {
|
|
1872
|
+
display: "grid"
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
}),
|
|
1876
|
+
...responsiveRules("grid-flex", {
|
|
1877
|
+
gridTemplateRows: "auto",
|
|
1878
|
+
"@nest": {
|
|
1879
|
+
"&:not([hidden])": {
|
|
1880
|
+
display: "grid-flex"
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
}),
|
|
1884
|
+
...responsiveRules("none", {
|
|
1885
|
+
"@nest": {
|
|
1886
|
+
"&:not([hidden])": {
|
|
1887
|
+
display: "none"
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
})
|
|
1891
|
+
}, flexRules = {
|
|
1892
|
+
// direction
|
|
1893
|
+
...responsiveRules("row", { flexDirection: "row" }),
|
|
1894
|
+
...responsiveRules("column", { flexDirection: "column" }),
|
|
1895
|
+
// align
|
|
1896
|
+
...responsiveRules("align-flex-start", { alignItems: "flex-start" }),
|
|
1897
|
+
...responsiveRules("align-flex-end", { alignItems: "end" }),
|
|
1898
|
+
...responsiveRules("align-center", { alignItems: "center" }),
|
|
1899
|
+
...responsiveRules("align-stretch", { alignItems: "stretch" }),
|
|
1900
|
+
...responsiveRules("align-baseline", { alignItems: "baseline" }),
|
|
1901
|
+
// justify
|
|
1902
|
+
...responsiveRules("justify-flex-start", { justifyContent: "flex-start" }),
|
|
1903
|
+
...responsiveRules("justify-flex-end", { justifyContent: "flex-end" }),
|
|
1904
|
+
...responsiveRules("justify-center", { justifyContent: "center" }),
|
|
1905
|
+
...responsiveRules("justify-between", { justifyContent: "space-between" }),
|
|
1906
|
+
...responsiveRules("justify-around", { justifyContent: "space-around" }),
|
|
1907
|
+
...responsiveRules("justify-evenly", { justifyContent: "space-evenly" }),
|
|
1908
|
+
// wrap
|
|
1909
|
+
...responsiveRules("wrap-nowrap", { flexWrap: "nowrap" }),
|
|
1910
|
+
...responsiveRules("wrap-wrap", { flexWrap: "wrap" }),
|
|
1911
|
+
...responsiveRules("wrap-reverse", { flexWrap: "wrap-reverse" })
|
|
1912
|
+
}, flexItemRules = {
|
|
1913
|
+
...responsiveRules("flex-none", { flex: "none" }),
|
|
1914
|
+
...responsiveRules("flex-1", { flex: 1 }),
|
|
1915
|
+
...responsiveRules("flex-2", { flex: 2 }),
|
|
1916
|
+
...responsiveRules("flex-3", { flex: 3 }),
|
|
1917
|
+
...responsiveRules("flex-4", { flex: 4 }),
|
|
1918
|
+
...responsiveRules("flex-5", { flex: 5 })
|
|
1919
|
+
}, fontRules = {
|
|
1920
|
+
font: {
|
|
1921
|
+
position: "relative",
|
|
1922
|
+
fontFamily: "var(--font-family)",
|
|
1923
|
+
fontSize: "var(--font-size)",
|
|
1924
|
+
lineHeight: "var(--font-line-height)",
|
|
1925
|
+
letterSpacing: "var(--font-letter-spacing)",
|
|
1926
|
+
fontWeight: "var(--font-weight)",
|
|
1927
|
+
transform: "translateY(var(--font-descender-height))",
|
|
1928
|
+
padding: "1px 0",
|
|
1929
|
+
margin: "0",
|
|
1930
|
+
"--font-cap-height": "calc(var(--font-line-height) - var(--font-ascender-height) - var(--font-descender-height))",
|
|
1931
|
+
"--font-icon-offset": "calc((var(--font-cap-height) - var(--font-icon-size)) / 2)",
|
|
1932
|
+
"--font-weight": "var(--font-weight-regular)",
|
|
1933
|
+
"@nest": {
|
|
1934
|
+
"&:before": {
|
|
1935
|
+
content: '""',
|
|
1936
|
+
display: "block",
|
|
1937
|
+
height: 0,
|
|
1938
|
+
marginTop: "calc((0px - var(--font-ascender-height) - var(--font-descender-height)) - 1px)"
|
|
1939
|
+
},
|
|
1940
|
+
"&:after": {
|
|
1941
|
+
content: '""',
|
|
1942
|
+
display: "block",
|
|
1943
|
+
height: 0,
|
|
1944
|
+
marginBottom: "-1px"
|
|
1945
|
+
},
|
|
1946
|
+
"& svg": {
|
|
1947
|
+
// Certain popular CSS libraries changes the defaults for SVG display
|
|
1948
|
+
// Make sure SVGs are rendered as inline elements
|
|
1949
|
+
display: "inline"
|
|
1950
|
+
},
|
|
1951
|
+
// todo
|
|
1952
|
+
// '& svg:not([data-sanity-icon])': {
|
|
1953
|
+
// fontSize: 'calc(var(--custom-icon-size) / 16 * 1rem)',
|
|
1954
|
+
// margin: 'var(--custom-icon-offset)',
|
|
1955
|
+
// },
|
|
1956
|
+
"& [data-sanity-icon]": {
|
|
1957
|
+
fontSize: "var(--font-icon-size)",
|
|
1958
|
+
margin: "var(--font-icon-offset)",
|
|
1959
|
+
vectorEffect: "non-scaling-stroke"
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
},
|
|
1963
|
+
"font-regular": {
|
|
1964
|
+
"--font-weight": "var(--font-weight-regular)"
|
|
1965
|
+
},
|
|
1966
|
+
"font-medium": {
|
|
1967
|
+
"--font-weight": "var(--font-weight-medium)"
|
|
1968
|
+
},
|
|
1969
|
+
"font-semibold": {
|
|
1970
|
+
"--font-weight": "var(--font-weight-semibold)"
|
|
1971
|
+
},
|
|
1972
|
+
"font-bold": {
|
|
1973
|
+
"--font-weight": "var(--font-weight-bold)"
|
|
1974
|
+
}
|
|
1975
|
+
}, gapRules = {
|
|
1976
|
+
...theme.SPACE.reduce((acc, space) => ({
|
|
1977
|
+
...acc,
|
|
1978
|
+
...responsiveRules(`g-${space}`, {
|
|
1979
|
+
gap: space === 0.5 ? "calc(var(--space-1) / 2)" : vars.space[space]
|
|
1980
|
+
})
|
|
1981
|
+
}), {}),
|
|
1982
|
+
...theme.SPACE.reduce((acc, space) => ({
|
|
1983
|
+
...acc,
|
|
1984
|
+
...responsiveRules(`gx-${space}`, {
|
|
1985
|
+
columnGap: space === 0.5 ? "calc(var(--space-1) / 2)" : vars.space[space]
|
|
1986
|
+
})
|
|
1987
|
+
}), {}),
|
|
1988
|
+
...theme.SPACE.reduce((acc, space) => ({
|
|
1989
|
+
...acc,
|
|
1990
|
+
...responsiveRules(`gy-${space}`, {
|
|
1991
|
+
rowGap: space === 0.5 ? "calc(var(--space-1) / 2)" : vars.space[space]
|
|
1992
|
+
})
|
|
1993
|
+
}), {})
|
|
1994
|
+
}, gridRules = {
|
|
1995
|
+
// autoCols
|
|
1996
|
+
...responsiveRules("auto-cols-auto", { gridAutoColumns: "auto" }),
|
|
1997
|
+
...responsiveRules("auto-cols-min", { gridAutoColumns: "min" }),
|
|
1998
|
+
...responsiveRules("auto-cols-max", { gridAutoColumns: "max" }),
|
|
1999
|
+
...responsiveRules("auto-cols-fr", { gridAutoColumns: "fr" }),
|
|
2000
|
+
// autoFlow
|
|
2001
|
+
...responsiveRules("auto-flow-row", { gridAutoFlow: "row" }),
|
|
2002
|
+
...responsiveRules("auto-flow-column", { gridAutoFlow: "column" }),
|
|
2003
|
+
...responsiveRules("auto-flow-row-dense", { gridAutoFlow: "row dense" }),
|
|
2004
|
+
...responsiveRules("auto-flow-column-dense", { gridAutoFlow: "column dense" }),
|
|
2005
|
+
// autoRows
|
|
2006
|
+
...responsiveRules("auto-rows-auto", { gridAutoRows: "auto" }),
|
|
2007
|
+
...responsiveRules("auto-rows-min", { gridAutoRows: "min-content" }),
|
|
2008
|
+
...responsiveRules("auto-rows-max", { gridAutoRows: "max-content" }),
|
|
2009
|
+
// ...responsiveRules('auto-rows-fr', {gridAutoRows: 'fr'}),
|
|
2010
|
+
// columns
|
|
2011
|
+
...responsiveRules("columns-1", { gridTemplateColumns: "repeat(1, 1fr)" }),
|
|
2012
|
+
...responsiveRules("columns-2", { gridTemplateColumns: "repeat(2, 1fr)" }),
|
|
2013
|
+
...responsiveRules("columns-3", { gridTemplateColumns: "repeat(3, 1fr)" }),
|
|
2014
|
+
...responsiveRules("columns-4", { gridTemplateColumns: "repeat(4, 1fr)" }),
|
|
2015
|
+
...responsiveRules("columns-5", { gridTemplateColumns: "repeat(5, 1fr)" }),
|
|
2016
|
+
...responsiveRules("columns-6", { gridTemplateColumns: "repeat(6, 1fr)" }),
|
|
2017
|
+
...responsiveRules("columns-7", { gridTemplateColumns: "repeat(7, 1fr)" }),
|
|
2018
|
+
...responsiveRules("columns-8", { gridTemplateColumns: "repeat(8, 1fr)" }),
|
|
2019
|
+
...responsiveRules("columns-9", { gridTemplateColumns: "repeat(9, 1fr)" }),
|
|
2020
|
+
...responsiveRules("columns-10", { gridTemplateColumns: "repeat(10, 1fr)" }),
|
|
2021
|
+
...responsiveRules("columns-12", { gridTemplateColumns: "repeat(12, 1fr)" })
|
|
2022
|
+
}, gridItemRules = {
|
|
2023
|
+
// column
|
|
2024
|
+
...responsiveRules("col-auto", { gridColumn: "span 1 / span 1" }),
|
|
2025
|
+
...responsiveRules("col-full", { gridColumn: "1 / -1" }),
|
|
2026
|
+
...responsiveRules("col-1", { gridColumn: "span 1 / span 1" }),
|
|
2027
|
+
...responsiveRules("col-2", { gridColumn: "span 2 / span 2" }),
|
|
2028
|
+
...responsiveRules("col-3", { gridColumn: "span 3 / span 3" }),
|
|
2029
|
+
...responsiveRules("col-4", { gridColumn: "span 4 / span 4" }),
|
|
2030
|
+
...responsiveRules("col-5", { gridColumn: "span 5 / span 5" }),
|
|
2031
|
+
...responsiveRules("col-6", { gridColumn: "span 6 / span 6" }),
|
|
2032
|
+
...responsiveRules("col-7", { gridColumn: "span 7 / span 7" }),
|
|
2033
|
+
...responsiveRules("col-8", { gridColumn: "span 8 / span 8" }),
|
|
2034
|
+
...responsiveRules("col-9", { gridColumn: "span 9 / span 9" }),
|
|
2035
|
+
...responsiveRules("col-10", { gridColumn: "span 10 / span 10" }),
|
|
2036
|
+
...responsiveRules("col-11", { gridColumn: "span 11 / span 11" }),
|
|
2037
|
+
...responsiveRules("col-12", { gridColumn: "span 12 / span 12" }),
|
|
2038
|
+
// columnStart
|
|
2039
|
+
...responsiveRules("col-start-auto", { gridColumnStart: "auto" }),
|
|
2040
|
+
...responsiveRules("col-start-1", { gridColumnStart: "1" }),
|
|
2041
|
+
...responsiveRules("col-start-2", { gridColumnStart: "2" }),
|
|
2042
|
+
...responsiveRules("col-start-3", { gridColumnStart: "3" }),
|
|
2043
|
+
...responsiveRules("col-start-4", { gridColumnStart: "4" }),
|
|
2044
|
+
...responsiveRules("col-start-5", { gridColumnStart: "5" }),
|
|
2045
|
+
...responsiveRules("col-start-6", { gridColumnStart: "6" }),
|
|
2046
|
+
...responsiveRules("col-start-7", { gridColumnStart: "7" }),
|
|
2047
|
+
...responsiveRules("col-start-8", { gridColumnStart: "8" }),
|
|
2048
|
+
...responsiveRules("col-start-9", { gridColumnStart: "9" }),
|
|
2049
|
+
...responsiveRules("col-start-10", { gridColumnStart: "10" }),
|
|
2050
|
+
...responsiveRules("col-start-11", { gridColumnStart: "11" }),
|
|
2051
|
+
...responsiveRules("col-start-12", { gridColumnStart: "12" }),
|
|
2052
|
+
// columnEnd
|
|
2053
|
+
...responsiveRules("col-end-auto", { gridColumnEnd: "auto" }),
|
|
2054
|
+
...responsiveRules("col-end-1", { gridColumnEnd: "1" }),
|
|
2055
|
+
...responsiveRules("col-end-2", { gridColumnEnd: "2" }),
|
|
2056
|
+
...responsiveRules("col-end-3", { gridColumnEnd: "3" }),
|
|
2057
|
+
...responsiveRules("col-end-4", { gridColumnEnd: "4" }),
|
|
2058
|
+
...responsiveRules("col-end-5", { gridColumnEnd: "5" }),
|
|
2059
|
+
...responsiveRules("col-end-6", { gridColumnEnd: "6" }),
|
|
2060
|
+
...responsiveRules("col-end-7", { gridColumnEnd: "7" }),
|
|
2061
|
+
...responsiveRules("col-end-8", { gridColumnEnd: "8" }),
|
|
2062
|
+
...responsiveRules("col-end-9", { gridColumnEnd: "9" }),
|
|
2063
|
+
...responsiveRules("col-end-10", { gridColumnEnd: "10" }),
|
|
2064
|
+
...responsiveRules("col-end-11", { gridColumnEnd: "11" }),
|
|
2065
|
+
...responsiveRules("col-end-12", { gridColumnEnd: "12" }),
|
|
2066
|
+
// row
|
|
2067
|
+
...responsiveRules("row-auto", { gridRow: "span 1 / span 1" }),
|
|
2068
|
+
...responsiveRules("row-full", { gridRow: "1 / -1" }),
|
|
2069
|
+
...responsiveRules("row-1", { gridRow: "span 1 / span 1" }),
|
|
2070
|
+
...responsiveRules("row-2", { gridRow: "span 2 / span 2" }),
|
|
2071
|
+
...responsiveRules("row-3", { gridRow: "span 3 / span 3" }),
|
|
2072
|
+
...responsiveRules("row-4", { gridRow: "span 4 / span 4" }),
|
|
2073
|
+
...responsiveRules("row-5", { gridRow: "span 5 / span 5" }),
|
|
2074
|
+
...responsiveRules("row-6", { gridRow: "span 6 / span 6" }),
|
|
2075
|
+
...responsiveRules("row-7", { gridRow: "span 7 / span 7" }),
|
|
2076
|
+
...responsiveRules("row-8", { gridRow: "span 8 / span 8" }),
|
|
2077
|
+
...responsiveRules("row-9", { gridRow: "span 9 / span 9" }),
|
|
2078
|
+
...responsiveRules("row-10", { gridRow: "span 10 / span 10" }),
|
|
2079
|
+
...responsiveRules("row-11", { gridRow: "span 11 / span 11" }),
|
|
2080
|
+
...responsiveRules("row-12", { gridRow: "span 12 / span 12" }),
|
|
2081
|
+
// rowStart
|
|
2082
|
+
...responsiveRules("row-start-auto", { gridRowStart: "auto" }),
|
|
2083
|
+
...responsiveRules("row-start-1", { gridRowStart: "1" }),
|
|
2084
|
+
...responsiveRules("row-start-2", { gridRowStart: "2" }),
|
|
2085
|
+
...responsiveRules("row-start-3", { gridRowStart: "3" }),
|
|
2086
|
+
...responsiveRules("row-start-4", { gridRowStart: "4" }),
|
|
2087
|
+
...responsiveRules("row-start-5", { gridRowStart: "5" }),
|
|
2088
|
+
...responsiveRules("row-start-6", { gridRowStart: "6" }),
|
|
2089
|
+
...responsiveRules("row-start-7", { gridRowStart: "7" }),
|
|
2090
|
+
...responsiveRules("row-start-8", { gridRowStart: "8" }),
|
|
2091
|
+
...responsiveRules("row-start-9", { gridRowStart: "9" }),
|
|
2092
|
+
...responsiveRules("row-start-10", { gridRowStart: "10" }),
|
|
2093
|
+
...responsiveRules("row-start-11", { gridRowStart: "11" }),
|
|
2094
|
+
...responsiveRules("row-start-12", { gridRowStart: "12" }),
|
|
2095
|
+
// rowEnd
|
|
2096
|
+
...responsiveRules("row-end-auto", { gridRowEnd: "auto" }),
|
|
2097
|
+
...responsiveRules("row-end-1", { gridRowEnd: "1" }),
|
|
2098
|
+
...responsiveRules("row-end-2", { gridRowEnd: "2" }),
|
|
2099
|
+
...responsiveRules("row-end-3", { gridRowEnd: "3" }),
|
|
2100
|
+
...responsiveRules("row-end-4", { gridRowEnd: "4" }),
|
|
2101
|
+
...responsiveRules("row-end-5", { gridRowEnd: "5" }),
|
|
2102
|
+
...responsiveRules("row-end-6", { gridRowEnd: "6" }),
|
|
2103
|
+
...responsiveRules("row-end-7", { gridRowEnd: "7" }),
|
|
2104
|
+
...responsiveRules("row-end-8", { gridRowEnd: "8" }),
|
|
2105
|
+
...responsiveRules("row-end-9", { gridRowEnd: "9" }),
|
|
2106
|
+
...responsiveRules("row-end-10", { gridRowEnd: "10" }),
|
|
2107
|
+
...responsiveRules("row-end-11", { gridRowEnd: "11" }),
|
|
2108
|
+
...responsiveRules("row-end-12", { gridRowEnd: "12" })
|
|
2109
|
+
}, heightRules = {
|
|
2110
|
+
...responsiveRules("h-fill", { height: "100%" }),
|
|
2111
|
+
...responsiveRules("h-stretch", { height: "stretch" })
|
|
2112
|
+
}, marginRules = theme.SPACE.reduce((acc, space) => ({
|
|
2113
|
+
...acc,
|
|
2114
|
+
...responsiveRules(`m-${space}`, { margin: vars.space[space] })
|
|
2115
|
+
}), {}), marginXRules = theme.SPACE.reduce((acc, space) => ({
|
|
2116
|
+
...acc,
|
|
2117
|
+
...responsiveRules(`mx-${space}`, {
|
|
2118
|
+
marginLeft: vars.space[space],
|
|
2119
|
+
marginRight: vars.space[space]
|
|
2120
|
+
})
|
|
2121
|
+
}), {}), marginYRules = theme.SPACE.reduce((acc, space) => ({
|
|
2122
|
+
...acc,
|
|
2123
|
+
...responsiveRules(`my-${space}`, {
|
|
2124
|
+
marginTop: vars.space[space],
|
|
2125
|
+
marginBottom: vars.space[space]
|
|
2126
|
+
})
|
|
2127
|
+
}), {}), marginTopRules = theme.SPACE.reduce((acc, space) => ({
|
|
2128
|
+
...acc,
|
|
2129
|
+
...responsiveRules(`mt-${space}`, { marginTop: vars.space[space] })
|
|
2130
|
+
}), {}), marginRightRules = theme.SPACE.reduce((acc, space) => ({
|
|
2131
|
+
...acc,
|
|
2132
|
+
...responsiveRules(`mr-${space}`, { marginRight: vars.space[space] })
|
|
2133
|
+
}), {}), marginBottomRules = theme.SPACE.reduce((acc, space) => ({
|
|
2134
|
+
...acc,
|
|
2135
|
+
...responsiveRules(`mb-${space}`, { marginBottom: vars.space[space] })
|
|
2136
|
+
}), {}), marginLeftRules = theme.SPACE.reduce((acc, space) => ({
|
|
2137
|
+
...acc,
|
|
2138
|
+
...responsiveRules(`ml-${space}`, { marginLeft: vars.space[space] })
|
|
2139
|
+
}), {}), maxWidthRules = {
|
|
2140
|
+
...responsiveRules("max-w-0", {
|
|
2141
|
+
maxWidth: "var(--container-0)"
|
|
2142
|
+
}),
|
|
2143
|
+
...responsiveRules("max-w-1", {
|
|
2144
|
+
maxWidth: "var(--container-1)"
|
|
2145
|
+
}),
|
|
2146
|
+
...responsiveRules("max-w-2", {
|
|
2147
|
+
maxWidth: "var(--container-2)"
|
|
2148
|
+
}),
|
|
2149
|
+
...responsiveRules("max-w-3", {
|
|
2150
|
+
maxWidth: "var(--container-3)"
|
|
2151
|
+
}),
|
|
2152
|
+
...responsiveRules("max-w-4", {
|
|
2153
|
+
maxWidth: "var(--container-4)"
|
|
2154
|
+
}),
|
|
2155
|
+
...responsiveRules("max-w-5", {
|
|
2156
|
+
maxWidth: "var(--container-5)"
|
|
2157
|
+
}),
|
|
2158
|
+
...responsiveRules("max-w-auto", {
|
|
2159
|
+
maxWidth: "none"
|
|
2160
|
+
}),
|
|
2161
|
+
...responsiveRules("max-w-fill", {
|
|
2162
|
+
maxWidth: "100%"
|
|
2163
|
+
})
|
|
2164
|
+
}, overflowRules = {
|
|
2165
|
+
...responsiveRules("overflow-visible", { overflow: "visible" }),
|
|
2166
|
+
...responsiveRules("overflow-hidden", { overflow: "hidden" }),
|
|
2167
|
+
...responsiveRules("overflow-scroll", { overflow: "scroll" }),
|
|
2168
|
+
...responsiveRules("overflow-auto", { overflow: "auto" })
|
|
2169
|
+
}, paddingRules = theme.SPACE.reduce((acc, space) => ({
|
|
2170
|
+
...acc,
|
|
2171
|
+
...responsiveRules(`p-${space}`, { padding: vars.space[space] })
|
|
2172
|
+
}), {}), paddingXRules = theme.SPACE.reduce((acc, space) => ({
|
|
2173
|
+
...acc,
|
|
2174
|
+
...responsiveRules(`px-${space}`, {
|
|
2175
|
+
paddingLeft: vars.space[space],
|
|
2176
|
+
paddingRight: vars.space[space]
|
|
2177
|
+
})
|
|
2178
|
+
}), {}), paddingYRules = theme.SPACE.reduce((acc, space) => ({
|
|
2179
|
+
...acc,
|
|
2180
|
+
...responsiveRules(`py-${space}`, {
|
|
2181
|
+
paddingTop: vars.space[space],
|
|
2182
|
+
paddingBottom: vars.space[space]
|
|
2183
|
+
})
|
|
2184
|
+
}), {}), paddingTopRules = theme.SPACE.reduce((acc, space) => ({
|
|
2185
|
+
...acc,
|
|
2186
|
+
...responsiveRules(`pt-${space}`, { paddingTop: vars.space[space] })
|
|
2187
|
+
}), {}), paddingRightRules = theme.SPACE.reduce((acc, space) => ({
|
|
2188
|
+
...acc,
|
|
2189
|
+
...responsiveRules(`pr-${space}`, { paddingRight: vars.space[space] })
|
|
2190
|
+
}), {}), paddingBottomRules = theme.SPACE.reduce((acc, space) => ({
|
|
2191
|
+
...acc,
|
|
2192
|
+
...responsiveRules(`pb-${space}`, { paddingBottom: vars.space[space] })
|
|
2193
|
+
}), {}), paddingLeftRules = theme.SPACE.reduce((acc, space) => ({
|
|
2194
|
+
...acc,
|
|
2195
|
+
...responsiveRules(`pl-${space}`, { paddingLeft: vars.space[space] })
|
|
2196
|
+
}), {}), pointerEventsRules = {
|
|
2197
|
+
"pointer-events-none": {
|
|
2198
|
+
pointerEvents: "none"
|
|
2199
|
+
},
|
|
2200
|
+
"pointer-events-auto": {
|
|
2201
|
+
pointerEvents: "auto"
|
|
2202
|
+
}
|
|
2203
|
+
}, positionRules = {
|
|
2204
|
+
...responsiveRules("pos-absolute", {
|
|
2205
|
+
position: "absolute"
|
|
2206
|
+
}),
|
|
2207
|
+
...responsiveRules("pos-fixed", {
|
|
2208
|
+
position: "fixed"
|
|
2209
|
+
}),
|
|
2210
|
+
...responsiveRules("pos-relative", {
|
|
2211
|
+
position: "relative"
|
|
2212
|
+
}),
|
|
2213
|
+
...responsiveRules("pos-static", {
|
|
2214
|
+
position: "static"
|
|
2215
|
+
}),
|
|
2216
|
+
...responsiveRules("pos-sticky", {
|
|
2217
|
+
position: "sticky"
|
|
2218
|
+
}),
|
|
2219
|
+
...responsiveRules("inset-0", {
|
|
2220
|
+
top: 0,
|
|
2221
|
+
left: 0,
|
|
2222
|
+
right: 0,
|
|
2223
|
+
bottom: 0
|
|
2224
|
+
})
|
|
2225
|
+
}, radiusRules = {
|
|
2226
|
+
...responsiveRules("r-0", { borderRadius: "var(--radius-0)" }),
|
|
2227
|
+
...responsiveRules("r-1", { borderRadius: "var(--radius-1)" }),
|
|
2228
|
+
...responsiveRules("r-2", { borderRadius: "var(--radius-2)" }),
|
|
2229
|
+
...responsiveRules("r-3", { borderRadius: "var(--radius-3)" }),
|
|
2230
|
+
...responsiveRules("r-4", { borderRadius: "var(--radius-4)" }),
|
|
2231
|
+
...responsiveRules("r-5", { borderRadius: "var(--radius-5)" }),
|
|
2232
|
+
...responsiveRules("r-6", { borderRadius: "var(--radius-6)" }),
|
|
2233
|
+
...responsiveRules("r-round", { borderRadius: "9999px" })
|
|
2234
|
+
}, shadowRules = {
|
|
2235
|
+
...responsiveRules("shadow-0", {
|
|
2236
|
+
boxShadow: "none"
|
|
2237
|
+
}),
|
|
2238
|
+
...responsiveRules("shadow-1", {
|
|
2239
|
+
boxShadow: [
|
|
2240
|
+
"var(--card-shadow-outline) var(--color-shadow-outline)",
|
|
2241
|
+
"var(--shadow-1-umbra) var(--color-shadow-umbra)",
|
|
2242
|
+
"var(--shadow-1-penumbra) var(--color-shadow-penumbra)",
|
|
2243
|
+
"var(--shadow-1-ambient) var(--color-shadow-ambient)"
|
|
2244
|
+
].join(", ")
|
|
2245
|
+
}),
|
|
2246
|
+
...responsiveRules("shadow-2", {
|
|
2247
|
+
boxShadow: [
|
|
2248
|
+
"var(--card-shadow-outline) var(--color-shadow-outline)",
|
|
2249
|
+
"var(--shadow-2-umbra) var(--color-shadow-umbra)",
|
|
2250
|
+
"var(--shadow-2-penumbra) var(--color-shadow-penumbra)",
|
|
2251
|
+
"var(--shadow-2-ambient) var(--color-shadow-ambient)"
|
|
2252
|
+
].join(", ")
|
|
2253
|
+
}),
|
|
2254
|
+
...responsiveRules("shadow-3", {
|
|
2255
|
+
boxShadow: [
|
|
2256
|
+
"var(--card-shadow-outline) var(--color-shadow-outline)",
|
|
2257
|
+
"var(--shadow-3-umbra) var(--color-shadow-umbra)",
|
|
2258
|
+
"var(--shadow-3-penumbra) var(--color-shadow-penumbra)",
|
|
2259
|
+
"var(--shadow-3-ambient) var(--color-shadow-ambient)"
|
|
2260
|
+
].join(", ")
|
|
2261
|
+
}),
|
|
2262
|
+
...responsiveRules("shadow-4", {
|
|
2263
|
+
boxShadow: [
|
|
2264
|
+
"var(--card-shadow-outline) var(--color-shadow-outline)",
|
|
2265
|
+
"var(--shadow-4-umbra) var(--color-shadow-umbra)",
|
|
2266
|
+
"var(--shadow-4-penumbra) var(--color-shadow-penumbra)",
|
|
2267
|
+
"var(--shadow-4-ambient) var(--color-shadow-ambient)"
|
|
2268
|
+
].join(", ")
|
|
2269
|
+
}),
|
|
2270
|
+
...responsiveRules("shadow-5", {
|
|
2271
|
+
boxShadow: [
|
|
2272
|
+
"var(--card-shadow-outline) var(--color-shadow-outline)",
|
|
2273
|
+
"var(--shadow-5-umbra) var(--color-shadow-umbra)",
|
|
2274
|
+
"var(--shadow-5-penumbra) var(--color-shadow-penumbra)",
|
|
2275
|
+
"var(--shadow-5-ambient) var(--color-shadow-ambient)"
|
|
2276
|
+
].join(", ")
|
|
2277
|
+
})
|
|
2278
|
+
}, widthRules = {
|
|
2279
|
+
"w-fill": {
|
|
2280
|
+
width: ["-moz-available", "-webkit-fill-available", "stretch"]
|
|
2281
|
+
}
|
|
2282
|
+
}, rules = {
|
|
2283
|
+
// styless
|
|
2284
|
+
...displayRules,
|
|
2285
|
+
...flexRules,
|
|
2286
|
+
...flexItemRules,
|
|
2287
|
+
...gridItemRules,
|
|
2288
|
+
...borderRules,
|
|
2289
|
+
...paddingRules,
|
|
2290
|
+
...paddingXRules,
|
|
2291
|
+
...paddingYRules,
|
|
2292
|
+
...paddingTopRules,
|
|
2293
|
+
...paddingRightRules,
|
|
2294
|
+
...paddingBottomRules,
|
|
2295
|
+
...paddingLeftRules,
|
|
2296
|
+
...pointerEventsRules,
|
|
2297
|
+
...marginRules,
|
|
2298
|
+
...marginXRules,
|
|
2299
|
+
...marginYRules,
|
|
2300
|
+
...marginTopRules,
|
|
2301
|
+
...marginRightRules,
|
|
2302
|
+
...marginBottomRules,
|
|
2303
|
+
...marginLeftRules,
|
|
2304
|
+
...fontRules,
|
|
2305
|
+
...gapRules,
|
|
2306
|
+
...gridRules,
|
|
2307
|
+
...heightRules,
|
|
2308
|
+
...overflowRules,
|
|
2309
|
+
...positionRules,
|
|
2310
|
+
...radiusRules,
|
|
2311
|
+
...shadowRules,
|
|
2312
|
+
...widthRules,
|
|
2313
|
+
// primitives
|
|
2314
|
+
...avatarRules,
|
|
2315
|
+
...badgeRules,
|
|
2316
|
+
...boxRules,
|
|
2317
|
+
...buttonRules,
|
|
2318
|
+
...cardRules,
|
|
2319
|
+
...checkboxRules,
|
|
2320
|
+
...codeRules,
|
|
2321
|
+
...containerRules,
|
|
2322
|
+
...headingRules,
|
|
2323
|
+
...kbdRules,
|
|
2324
|
+
...labelRules,
|
|
2325
|
+
...maxWidthRules,
|
|
2326
|
+
...popoverRules,
|
|
2327
|
+
...radioRules,
|
|
2328
|
+
...selectRules,
|
|
2329
|
+
...selectableRules,
|
|
2330
|
+
...spinnerRules,
|
|
2331
|
+
...switchRules,
|
|
2332
|
+
...textRules,
|
|
2333
|
+
...textAreaRules,
|
|
2334
|
+
...textInputRules,
|
|
2335
|
+
...tokenRules,
|
|
2336
|
+
...tooltipRules,
|
|
2337
|
+
// components
|
|
2338
|
+
...breadcrumbsRules,
|
|
2339
|
+
...dialogRules
|
|
2340
|
+
};
|
|
2341
|
+
function compileRule(selector, props) {
|
|
2342
|
+
return compileProperties(selector, props) + compileNestedRules(selector, props["@nest"]);
|
|
2343
|
+
}
|
|
2344
|
+
function compileProperties(selector, props) {
|
|
2345
|
+
let css = "{";
|
|
2346
|
+
for (const key in props) {
|
|
2347
|
+
if (key === "@keyframes" || key === "@media" || key === "@nest") continue;
|
|
2348
|
+
const value = props[key], valueArr = Array.isArray(value) ? value : [value];
|
|
2349
|
+
for (const v of valueArr)
|
|
2350
|
+
css += toSnakeCase(key) + ":" + v + ";";
|
|
2351
|
+
}
|
|
2352
|
+
return css.length === 1 ? "" : selector + css + "}";
|
|
2353
|
+
}
|
|
2354
|
+
function compileNestedRules(selector, props) {
|
|
2355
|
+
if (!props) return "";
|
|
2356
|
+
let css = "";
|
|
2357
|
+
for (const key in props) {
|
|
2358
|
+
const value = props[key];
|
|
2359
|
+
css += `
|
|
2360
|
+
` + key.replace(/&/g, selector) + compileProperties(selector, value).substring(selector.length);
|
|
2361
|
+
}
|
|
2362
|
+
return css;
|
|
2363
|
+
}
|
|
2364
|
+
function compileMediaQueryRule(query, rules2) {
|
|
2365
|
+
let css = `@media ${query}{`;
|
|
2366
|
+
for (const key in rules2)
|
|
2367
|
+
css += `
|
|
2368
|
+
` + compileRule(`.${key}`.replace(/:/g, "\\:"), rules2[key]);
|
|
2369
|
+
return css + `
|
|
2370
|
+
}`;
|
|
2371
|
+
}
|
|
2372
|
+
function toSnakeCase(value) {
|
|
2373
|
+
return value.replace(/[A-Z]/g, (match) => "-" + match.toLowerCase());
|
|
2374
|
+
}
|
|
2375
|
+
function compileRules(rules2) {
|
|
2376
|
+
let css = "";
|
|
2377
|
+
const keyframes = {}, mediaQueries = {};
|
|
2378
|
+
for (const [className, props] of Object.entries(rules2)) {
|
|
2379
|
+
const selectorCss = compileRule(`.${className}`.replace(/:/g, "\\:"), props);
|
|
2380
|
+
if (css += selectorCss ? `${selectorCss}
|
|
2381
|
+
` : "", props["@keyframes"])
|
|
2382
|
+
for (const name in props["@keyframes"])
|
|
2383
|
+
keyframes[name] = props["@keyframes"][name];
|
|
2384
|
+
if (props["@media"])
|
|
2385
|
+
for (const key in props["@media"])
|
|
2386
|
+
mediaQueries[key] || (mediaQueries[key] = {}), mediaQueries[key][className] = props["@media"][key];
|
|
2387
|
+
}
|
|
2388
|
+
for (const [name, value] of Object.entries(keyframes)) {
|
|
2389
|
+
let keyframesCss = `@keyframes ${name} {
|
|
2390
|
+
`;
|
|
2391
|
+
for (const [key, props] of Object.entries(value))
|
|
2392
|
+
keyframesCss += ` ${key} {
|
|
2393
|
+
`, keyframesCss += compileRule("", props).replace(/\n/g, `
|
|
2394
|
+
`) + `
|
|
2395
|
+
`, keyframesCss += ` }
|
|
2396
|
+
`;
|
|
2397
|
+
keyframesCss += `}
|
|
2398
|
+
`, css += keyframesCss;
|
|
2399
|
+
}
|
|
2400
|
+
for (const [query, queryRules] of Object.entries(mediaQueries))
|
|
2401
|
+
css += compileMediaQueryRule(query, queryRules) + `
|
|
2402
|
+
`;
|
|
2403
|
+
return css.replace(/\n{2,}/g, `
|
|
2404
|
+
`).trimStart();
|
|
2405
|
+
}
|
|
2406
|
+
function compileSystem() {
|
|
2407
|
+
return compileRules(rules);
|
|
2408
|
+
}
|
|
2409
|
+
function rem(value) {
|
|
2410
|
+
return value === 0 ? "0" : `${value / 16}rem`;
|
|
2411
|
+
}
|
|
2412
|
+
function px(value) {
|
|
2413
|
+
return value === 0 ? "0" : `${value}px`;
|
|
2414
|
+
}
|
|
2415
|
+
function toBoxShadow(value) {
|
|
2416
|
+
return value ? value.map((n) => px(n)).join(" ") : "none";
|
|
2417
|
+
}
|
|
2418
|
+
function countThemeEntries(obj) {
|
|
2419
|
+
let count = 0;
|
|
2420
|
+
if (isArray(obj))
|
|
2421
|
+
for (let i = 0; i < obj.length; i++) {
|
|
2422
|
+
const value = obj[i];
|
|
2423
|
+
isRecord(value) || isArray(value) ? count += countThemeEntries(value) : count++;
|
|
2424
|
+
}
|
|
2425
|
+
else
|
|
2426
|
+
for (const [key, value] of Object.entries(obj))
|
|
2427
|
+
key.startsWith("_") || (isRecord(value) || isArray(value) ? count += countThemeEntries(value) : count++);
|
|
2428
|
+
return count;
|
|
2429
|
+
}
|
|
2430
|
+
function compileTheme(theme2) {
|
|
2431
|
+
for (const [key, val] of Object.entries(theme2.color.light.default))
|
|
2432
|
+
(isRecord(val) || isArray(val)) && console.log(key, countThemeEntries(val));
|
|
2433
|
+
return [
|
|
2434
|
+
compileRule(".root", {
|
|
2435
|
+
[varNames.avatar.focusRing.offset]: px(theme2.avatar.focusRing.offset),
|
|
2436
|
+
[varNames.avatar.focusRing.width]: px(theme2.avatar.focusRing.width),
|
|
2437
|
+
// [varNames.avatar.size[0].distance]: px(theme.avatar.size[0].distance),
|
|
2438
|
+
// [varNames.avatar.size[0].size]: px(theme.avatar.size[0].size),
|
|
2439
|
+
"--avatar-0-distance": px(theme2.avatar.sizes[0].distance),
|
|
2440
|
+
"--avatar-0-size": px(theme2.avatar.sizes[0].size),
|
|
2441
|
+
"--avatar-1-distance": px(theme2.avatar.sizes[1].distance),
|
|
2442
|
+
"--avatar-1-size": px(theme2.avatar.sizes[1].size),
|
|
2443
|
+
"--avatar-2-distance": px(theme2.avatar.sizes[2].distance),
|
|
2444
|
+
"--avatar-2-size": px(theme2.avatar.sizes[2].size),
|
|
2445
|
+
"--avatar-3-distance": px(theme2.avatar.sizes[3].distance),
|
|
2446
|
+
"--avatar-3-size": px(theme2.avatar.sizes[3].size),
|
|
2447
|
+
"--button-border-width": px(theme2.button.border.width),
|
|
2448
|
+
"--button-focus-ring-offset": px(theme2.button.focusRing.offset),
|
|
2449
|
+
"--button-focus-ring-width": px(theme2.button.focusRing.width),
|
|
2450
|
+
"--button-text-weight": `${theme2.button.textWeight}`,
|
|
2451
|
+
"--card-border-width": px(theme2.card.border.width),
|
|
2452
|
+
"--card-focus-ring-offset": px(theme2.card.focusRing.offset),
|
|
2453
|
+
"--card-focus-ring-width": px(theme2.card.focusRing.width),
|
|
2454
|
+
"--card-shadow-outline": `0 0 0 ${px(theme2.card.shadow.outline)}`,
|
|
2455
|
+
"--font-code-family": theme2.font.code.family,
|
|
2456
|
+
"--font-code-weight-regular": `${theme2.font.code.weights.regular}`,
|
|
2457
|
+
"--font-code-weight-medium": `${theme2.font.code.weights.medium}`,
|
|
2458
|
+
"--font-code-weight-semibold": `${theme2.font.code.weights.semibold}`,
|
|
2459
|
+
"--font-code-weight-bold": `${theme2.font.code.weights.bold}`,
|
|
2460
|
+
"--font-code-0-size": rem(theme2.font.code.sizes[0].fontSize),
|
|
2461
|
+
"--font-code-0-line-height": rem(theme2.font.code.sizes[0].lineHeight),
|
|
2462
|
+
"--font-code-0-ascender-height": px(theme2.font.code.sizes[0].ascenderHeight),
|
|
2463
|
+
"--font-code-0-descender-height": px(theme2.font.code.sizes[0].descenderHeight),
|
|
2464
|
+
"--font-code-0-letter-spacing": px(theme2.font.code.sizes[0].letterSpacing),
|
|
2465
|
+
"--font-code-0-icon-size": px(theme2.font.code.sizes[0].iconSize),
|
|
2466
|
+
"--font-code-1-size": rem(theme2.font.code.sizes[1].fontSize),
|
|
2467
|
+
"--font-code-1-line-height": px(theme2.font.code.sizes[1].lineHeight),
|
|
2468
|
+
"--font-code-1-ascender-height": px(theme2.font.code.sizes[1].ascenderHeight),
|
|
2469
|
+
"--font-code-1-descender-height": px(theme2.font.code.sizes[1].descenderHeight),
|
|
2470
|
+
"--font-code-1-letter-spacing": px(theme2.font.code.sizes[1].letterSpacing),
|
|
2471
|
+
"--font-code-1-icon-size": px(theme2.font.code.sizes[1].iconSize),
|
|
2472
|
+
"--font-code-2-size": rem(theme2.font.code.sizes[2].fontSize),
|
|
2473
|
+
"--font-code-2-line-height": rem(theme2.font.code.sizes[2].lineHeight),
|
|
2474
|
+
"--font-code-2-ascender-height": px(theme2.font.code.sizes[2].ascenderHeight),
|
|
2475
|
+
"--font-code-2-descender-height": px(theme2.font.code.sizes[2].descenderHeight),
|
|
2476
|
+
"--font-code-2-letter-spacing": px(theme2.font.code.sizes[2].letterSpacing),
|
|
2477
|
+
"--font-code-2-icon-size": px(theme2.font.code.sizes[2].iconSize),
|
|
2478
|
+
"--font-code-3-size": rem(theme2.font.code.sizes[3].fontSize),
|
|
2479
|
+
"--font-code-3-line-height": rem(theme2.font.code.sizes[3].lineHeight),
|
|
2480
|
+
"--font-code-3-ascender-height": px(theme2.font.code.sizes[3].ascenderHeight),
|
|
2481
|
+
"--font-code-3-descender-height": px(theme2.font.code.sizes[3].descenderHeight),
|
|
2482
|
+
"--font-code-3-letter-spacing": px(theme2.font.code.sizes[3].letterSpacing),
|
|
2483
|
+
"--font-code-3-icon-size": px(theme2.font.code.sizes[3].iconSize),
|
|
2484
|
+
"--font-code-4-size": rem(theme2.font.code.sizes[4].fontSize),
|
|
2485
|
+
"--font-code-4-line-height": rem(theme2.font.code.sizes[4].lineHeight),
|
|
2486
|
+
"--font-code-4-ascender-height": px(theme2.font.code.sizes[4].ascenderHeight),
|
|
2487
|
+
"--font-code-4-descender-height": px(theme2.font.code.sizes[4].descenderHeight),
|
|
2488
|
+
"--font-code-4-letter-spacing": px(theme2.font.code.sizes[4].letterSpacing),
|
|
2489
|
+
"--font-code-4-icon-size": px(theme2.font.code.sizes[4].iconSize),
|
|
2490
|
+
"--font-heading-family": theme2.font.heading.family,
|
|
2491
|
+
"--font-heading-weight-regular": `${theme2.font.heading.weights.regular}`,
|
|
2492
|
+
"--font-heading-weight-medium": `${theme2.font.heading.weights.medium}`,
|
|
2493
|
+
"--font-heading-weight-semibold": `${theme2.font.heading.weights.semibold}`,
|
|
2494
|
+
"--font-heading-weight-bold": `${theme2.font.heading.weights.bold}`,
|
|
2495
|
+
"--font-heading-0-size": rem(theme2.font.heading.sizes[0].fontSize),
|
|
2496
|
+
"--font-heading-0-line-height": rem(theme2.font.heading.sizes[0].lineHeight),
|
|
2497
|
+
"--font-heading-0-ascender-height": px(theme2.font.heading.sizes[0].ascenderHeight),
|
|
2498
|
+
"--font-heading-0-descender-height": px(theme2.font.heading.sizes[0].descenderHeight),
|
|
2499
|
+
"--font-heading-0-letter-spacing": px(theme2.font.heading.sizes[0].letterSpacing),
|
|
2500
|
+
"--font-heading-0-icon-size": px(theme2.font.heading.sizes[0].iconSize),
|
|
2501
|
+
"--font-heading-1-size": rem(theme2.font.heading.sizes[1].fontSize),
|
|
2502
|
+
"--font-heading-1-line-height": rem(theme2.font.heading.sizes[1].lineHeight),
|
|
2503
|
+
"--font-heading-1-ascender-height": px(theme2.font.heading.sizes[1].ascenderHeight),
|
|
2504
|
+
"--font-heading-1-descender-height": px(theme2.font.heading.sizes[1].descenderHeight),
|
|
2505
|
+
"--font-heading-1-letter-spacing": px(theme2.font.heading.sizes[1].letterSpacing),
|
|
2506
|
+
"--font-heading-1-icon-size": px(theme2.font.heading.sizes[1].iconSize),
|
|
2507
|
+
"--font-heading-2-size": rem(theme2.font.heading.sizes[2].fontSize),
|
|
2508
|
+
"--font-heading-2-line-height": rem(theme2.font.heading.sizes[2].lineHeight),
|
|
2509
|
+
"--font-heading-2-ascender-height": px(theme2.font.heading.sizes[2].ascenderHeight),
|
|
2510
|
+
"--font-heading-2-descender-height": px(theme2.font.heading.sizes[2].descenderHeight),
|
|
2511
|
+
"--font-heading-2-letter-spacing": px(theme2.font.heading.sizes[2].letterSpacing),
|
|
2512
|
+
"--font-heading-2-icon-size": px(theme2.font.heading.sizes[2].iconSize),
|
|
2513
|
+
"--font-heading-3-size": rem(theme2.font.heading.sizes[3].fontSize),
|
|
2514
|
+
"--font-heading-3-line-height": rem(theme2.font.heading.sizes[3].lineHeight),
|
|
2515
|
+
"--font-heading-3-ascender-height": px(theme2.font.heading.sizes[3].ascenderHeight),
|
|
2516
|
+
"--font-heading-3-descender-height": px(theme2.font.heading.sizes[3].descenderHeight),
|
|
2517
|
+
"--font-heading-3-letter-spacing": px(theme2.font.heading.sizes[3].letterSpacing),
|
|
2518
|
+
"--font-heading-3-icon-size": px(theme2.font.heading.sizes[3].iconSize),
|
|
2519
|
+
"--font-heading-4-size": rem(theme2.font.heading.sizes[4].fontSize),
|
|
2520
|
+
"--font-heading-4-line-height": rem(theme2.font.heading.sizes[4].lineHeight),
|
|
2521
|
+
"--font-heading-4-ascender-height": px(theme2.font.heading.sizes[4].ascenderHeight),
|
|
2522
|
+
"--font-heading-4-descender-height": px(theme2.font.heading.sizes[4].descenderHeight),
|
|
2523
|
+
"--font-heading-4-letter-spacing": px(theme2.font.heading.sizes[4].letterSpacing),
|
|
2524
|
+
"--font-heading-4-icon-size": px(theme2.font.heading.sizes[4].iconSize),
|
|
2525
|
+
"--font-heading-5-size": rem(theme2.font.heading.sizes[5].fontSize),
|
|
2526
|
+
"--font-heading-5-line-height": rem(theme2.font.heading.sizes[5].lineHeight),
|
|
2527
|
+
"--font-heading-5-ascender-height": px(theme2.font.heading.sizes[5].ascenderHeight),
|
|
2528
|
+
"--font-heading-5-descender-height": px(theme2.font.heading.sizes[5].descenderHeight),
|
|
2529
|
+
"--font-heading-5-letter-spacing": px(theme2.font.heading.sizes[5].letterSpacing),
|
|
2530
|
+
"--font-heading-5-icon-size": px(theme2.font.heading.sizes[5].iconSize),
|
|
2531
|
+
"--font-label-family": theme2.font.label.family,
|
|
2532
|
+
"--font-label-weight-regular": `${theme2.font.label.weights.regular}`,
|
|
2533
|
+
"--font-label-weight-medium": `${theme2.font.label.weights.medium}`,
|
|
2534
|
+
"--font-label-weight-semibold": `${theme2.font.label.weights.semibold}`,
|
|
2535
|
+
"--font-label-weight-bold": `${theme2.font.label.weights.bold}`,
|
|
2536
|
+
"--font-label-0-size": rem(theme2.font.label.sizes[0].fontSize),
|
|
2537
|
+
"--font-label-0-line-height": rem(theme2.font.label.sizes[0].lineHeight),
|
|
2538
|
+
"--font-label-0-ascender-height": px(theme2.font.label.sizes[0].ascenderHeight),
|
|
2539
|
+
"--font-label-0-descender-height": px(theme2.font.label.sizes[0].descenderHeight),
|
|
2540
|
+
"--font-label-0-letter-spacing": px(theme2.font.label.sizes[0].letterSpacing),
|
|
2541
|
+
"--font-label-0-icon-size": px(theme2.font.label.sizes[0].iconSize),
|
|
2542
|
+
"--font-label-1-size": rem(theme2.font.label.sizes[1].fontSize),
|
|
2543
|
+
"--font-label-1-line-height": rem(theme2.font.label.sizes[1].lineHeight),
|
|
2544
|
+
"--font-label-1-ascender-height": px(theme2.font.label.sizes[1].ascenderHeight),
|
|
2545
|
+
"--font-label-1-descender-height": px(theme2.font.label.sizes[1].descenderHeight),
|
|
2546
|
+
"--font-label-1-letter-spacing": px(theme2.font.label.sizes[1].letterSpacing),
|
|
2547
|
+
"--font-label-1-icon-size": px(theme2.font.label.sizes[1].iconSize),
|
|
2548
|
+
"--font-label-2-size": rem(theme2.font.label.sizes[2].fontSize),
|
|
2549
|
+
"--font-label-2-line-height": rem(theme2.font.label.sizes[2].lineHeight),
|
|
2550
|
+
"--font-label-2-ascender-height": px(theme2.font.label.sizes[2].ascenderHeight),
|
|
2551
|
+
"--font-label-2-descender-height": px(theme2.font.label.sizes[2].descenderHeight),
|
|
2552
|
+
"--font-label-2-letter-spacing": px(theme2.font.label.sizes[2].letterSpacing),
|
|
2553
|
+
"--font-label-2-icon-size": px(theme2.font.label.sizes[2].iconSize),
|
|
2554
|
+
"--font-label-3-size": rem(theme2.font.label.sizes[3].fontSize),
|
|
2555
|
+
"--font-label-3-line-height": rem(theme2.font.label.sizes[3].lineHeight),
|
|
2556
|
+
"--font-label-3-ascender-height": px(theme2.font.label.sizes[3].ascenderHeight),
|
|
2557
|
+
"--font-label-3-descender-height": px(theme2.font.label.sizes[3].descenderHeight),
|
|
2558
|
+
"--font-label-3-letter-spacing": px(theme2.font.label.sizes[3].letterSpacing),
|
|
2559
|
+
"--font-label-3-icon-size": px(theme2.font.label.sizes[3].iconSize),
|
|
2560
|
+
"--font-label-4-size": rem(theme2.font.label.sizes[4].fontSize),
|
|
2561
|
+
"--font-label-4-line-height": rem(theme2.font.label.sizes[4].lineHeight),
|
|
2562
|
+
"--font-label-4-ascender-height": px(theme2.font.label.sizes[4].ascenderHeight),
|
|
2563
|
+
"--font-label-4-descender-height": px(theme2.font.label.sizes[4].descenderHeight),
|
|
2564
|
+
"--font-label-4-letter-spacing": px(theme2.font.label.sizes[4].letterSpacing),
|
|
2565
|
+
"--font-label-4-icon-size": px(theme2.font.label.sizes[4].iconSize),
|
|
2566
|
+
"--font-label-5-size": rem(theme2.font.label.sizes[5].fontSize),
|
|
2567
|
+
"--font-label-5-line-height": rem(theme2.font.label.sizes[5].lineHeight),
|
|
2568
|
+
"--font-label-5-ascender-height": px(theme2.font.label.sizes[5].ascenderHeight),
|
|
2569
|
+
"--font-label-5-descender-height": px(theme2.font.label.sizes[5].descenderHeight),
|
|
2570
|
+
"--font-label-5-letter-spacing": px(theme2.font.label.sizes[5].letterSpacing),
|
|
2571
|
+
"--font-label-5-icon-size": px(theme2.font.label.sizes[5].iconSize),
|
|
2572
|
+
"--font-text-family": theme2.font.text.family,
|
|
2573
|
+
"--font-text-weight-regular": `${theme2.font.text.weights.regular}`,
|
|
2574
|
+
"--font-text-weight-medium": `${theme2.font.text.weights.medium}`,
|
|
2575
|
+
"--font-text-weight-semibold": `${theme2.font.text.weights.semibold}`,
|
|
2576
|
+
"--font-text-weight-bold": `${theme2.font.text.weights.bold}`,
|
|
2577
|
+
"--font-text-0-size": rem(theme2.font.text.sizes[0].fontSize),
|
|
2578
|
+
"--font-text-0-line-height": rem(theme2.font.text.sizes[0].lineHeight),
|
|
2579
|
+
"--font-text-0-ascender-height": px(theme2.font.text.sizes[0].ascenderHeight),
|
|
2580
|
+
"--font-text-0-descender-height": px(theme2.font.text.sizes[0].descenderHeight),
|
|
2581
|
+
"--font-text-0-letter-spacing": px(theme2.font.text.sizes[0].letterSpacing),
|
|
2582
|
+
"--font-text-0-icon-size": px(theme2.font.text.sizes[0].iconSize),
|
|
2583
|
+
"--font-text-1-size": rem(theme2.font.text.sizes[1].fontSize),
|
|
2584
|
+
"--font-text-1-line-height": rem(theme2.font.text.sizes[1].lineHeight),
|
|
2585
|
+
"--font-text-1-ascender-height": px(theme2.font.text.sizes[1].ascenderHeight),
|
|
2586
|
+
"--font-text-1-descender-height": px(theme2.font.text.sizes[1].descenderHeight),
|
|
2587
|
+
"--font-text-1-letter-spacing": px(theme2.font.text.sizes[1].letterSpacing),
|
|
2588
|
+
"--font-text-1-icon-size": px(theme2.font.text.sizes[1].iconSize),
|
|
2589
|
+
"--font-text-2-size": rem(theme2.font.text.sizes[2].fontSize),
|
|
2590
|
+
"--font-text-2-line-height": rem(theme2.font.text.sizes[2].lineHeight),
|
|
2591
|
+
"--font-text-2-ascender-height": px(theme2.font.text.sizes[2].ascenderHeight),
|
|
2592
|
+
"--font-text-2-descender-height": px(theme2.font.text.sizes[2].descenderHeight),
|
|
2593
|
+
"--font-text-2-letter-spacing": px(theme2.font.text.sizes[2].letterSpacing),
|
|
2594
|
+
"--font-text-2-icon-size": px(theme2.font.text.sizes[2].iconSize),
|
|
2595
|
+
"--font-text-3-size": rem(theme2.font.text.sizes[3].fontSize),
|
|
2596
|
+
"--font-text-3-line-height": rem(theme2.font.text.sizes[3].lineHeight),
|
|
2597
|
+
"--font-text-3-ascender-height": px(theme2.font.text.sizes[3].ascenderHeight),
|
|
2598
|
+
"--font-text-3-descender-height": px(theme2.font.text.sizes[3].descenderHeight),
|
|
2599
|
+
"--font-text-3-letter-spacing": px(theme2.font.text.sizes[3].letterSpacing),
|
|
2600
|
+
"--font-text-3-icon-size": px(theme2.font.text.sizes[3].iconSize),
|
|
2601
|
+
"--font-text-4-size": rem(theme2.font.text.sizes[4].fontSize),
|
|
2602
|
+
"--font-text-4-line-height": rem(theme2.font.text.sizes[4].lineHeight),
|
|
2603
|
+
"--font-text-4-ascender-height": px(theme2.font.text.sizes[4].ascenderHeight),
|
|
2604
|
+
"--font-text-4-descender-height": px(theme2.font.text.sizes[4].descenderHeight),
|
|
2605
|
+
"--font-text-4-letter-spacing": px(theme2.font.text.sizes[4].letterSpacing),
|
|
2606
|
+
"--font-text-4-icon-size": px(theme2.font.text.sizes[4].iconSize),
|
|
2607
|
+
"--input-border-width": px(theme2.input.border.width),
|
|
2608
|
+
"--input-checkbox-focus-ring-offset": px(theme2.input.checkbox.focusRing.offset),
|
|
2609
|
+
"--input-checkbox-focus-ring-width": px(theme2.input.checkbox.focusRing.width),
|
|
2610
|
+
"--input-checkbox-size": px(theme2.input.checkbox.size),
|
|
2611
|
+
"--input-radio-focus-ring-offset": px(theme2.input.radio.focusRing.offset),
|
|
2612
|
+
"--input-radio-focus-ring-width": px(theme2.input.radio.focusRing.width),
|
|
2613
|
+
"--input-radio-mark-size": px(theme2.input.radio.markSize),
|
|
2614
|
+
"--input-radio-size": px(theme2.input.radio.size),
|
|
2615
|
+
"--input-select-focus-ring-offset": px(theme2.input.select.focusRing.offset),
|
|
2616
|
+
"--input-select-focus-ring-width": px(theme2.input.select.focusRing.width),
|
|
2617
|
+
"--input-switch-focus-ring-offset": px(theme2.input.switch.focusRing.offset),
|
|
2618
|
+
"--input-switch-focus-ring-width": px(theme2.input.switch.focusRing.width),
|
|
2619
|
+
"--input-switch-width": px(theme2.input.switch.width),
|
|
2620
|
+
"--input-switch-height": px(theme2.input.switch.height),
|
|
2621
|
+
"--input-switch-padding": px(theme2.input.switch.padding),
|
|
2622
|
+
"--input-switch-transition-duration-ms": px(theme2.input.switch.transitionDurationMs),
|
|
2623
|
+
"--input-switch-transition-timing-function": theme2.input.switch.transitionTimingFunction,
|
|
2624
|
+
"--input-text-focus-ring-offset": px(theme2.input.text.focusRing.offset),
|
|
2625
|
+
"--input-text-focus-ring-width": px(theme2.input.text.focusRing.width),
|
|
2626
|
+
"--container-0": px(theme2.container[0]),
|
|
2627
|
+
"--container-1": px(theme2.container[1]),
|
|
2628
|
+
"--container-2": px(theme2.container[2]),
|
|
2629
|
+
"--container-3": px(theme2.container[3]),
|
|
2630
|
+
"--container-4": px(theme2.container[4]),
|
|
2631
|
+
"--container-5": px(theme2.container[5]),
|
|
2632
|
+
"--radius-0": px(theme2.radius[0]),
|
|
2633
|
+
"--radius-1": px(theme2.radius[1]),
|
|
2634
|
+
"--radius-2": px(theme2.radius[2]),
|
|
2635
|
+
"--radius-3": px(theme2.radius[3]),
|
|
2636
|
+
"--radius-4": px(theme2.radius[4]),
|
|
2637
|
+
"--radius-5": px(theme2.radius[5]),
|
|
2638
|
+
"--radius-6": px(theme2.radius[6]),
|
|
2639
|
+
[varNames.space[0]]: rem(theme2.space[0]),
|
|
2640
|
+
[varNames.space[1]]: rem(theme2.space[1]),
|
|
2641
|
+
[varNames.space[2]]: rem(theme2.space[2]),
|
|
2642
|
+
[varNames.space[3]]: rem(theme2.space[3]),
|
|
2643
|
+
[varNames.space[4]]: rem(theme2.space[4]),
|
|
2644
|
+
[varNames.space[5]]: rem(theme2.space[5]),
|
|
2645
|
+
[varNames.space[6]]: rem(theme2.space[6]),
|
|
2646
|
+
[varNames.space[7]]: rem(theme2.space[7]),
|
|
2647
|
+
[varNames.space[8]]: rem(theme2.space[8]),
|
|
2648
|
+
[varNames.space[9]]: rem(theme2.space[9]),
|
|
2649
|
+
"--shadow-0-umbra": toBoxShadow(theme2.shadow[0]?.umbra),
|
|
2650
|
+
//`${theme.shadow[0]?.umbra || 'none'}`,
|
|
2651
|
+
"--shadow-0-penumbra": toBoxShadow(theme2.shadow[0]?.penumbra),
|
|
2652
|
+
"--shadow-0-ambient": toBoxShadow(theme2.shadow[0]?.ambient),
|
|
2653
|
+
"--shadow-1-umbra": toBoxShadow(theme2.shadow[1]?.umbra),
|
|
2654
|
+
"--shadow-1-penumbra": toBoxShadow(theme2.shadow[1]?.penumbra),
|
|
2655
|
+
"--shadow-1-ambient": toBoxShadow(theme2.shadow[1]?.ambient),
|
|
2656
|
+
"--shadow-2-umbra": toBoxShadow(theme2.shadow[2]?.umbra),
|
|
2657
|
+
"--shadow-2-penumbra": toBoxShadow(theme2.shadow[2]?.penumbra),
|
|
2658
|
+
"--shadow-2-ambient": toBoxShadow(theme2.shadow[2]?.ambient),
|
|
2659
|
+
"--shadow-3-umbra": toBoxShadow(theme2.shadow[3]?.umbra),
|
|
2660
|
+
"--shadow-3-penumbra": toBoxShadow(theme2.shadow[3]?.penumbra),
|
|
2661
|
+
"--shadow-3-ambient": toBoxShadow(theme2.shadow[3]?.ambient),
|
|
2662
|
+
"--shadow-4-umbra": toBoxShadow(theme2.shadow[4]?.umbra),
|
|
2663
|
+
"--shadow-4-penumbra": toBoxShadow(theme2.shadow[4]?.penumbra),
|
|
2664
|
+
"--shadow-4-ambient": toBoxShadow(theme2.shadow[4]?.ambient),
|
|
2665
|
+
"--shadow-5-umbra": toBoxShadow(theme2.shadow[5]?.umbra),
|
|
2666
|
+
"--shadow-5-penumbra": toBoxShadow(theme2.shadow[5]?.penumbra),
|
|
2667
|
+
"--shadow-5-ambient": toBoxShadow(theme2.shadow[5]?.ambient),
|
|
2668
|
+
...Object.fromEntries(
|
|
2669
|
+
getThemeEntries(theme2.color, ["color"])
|
|
2670
|
+
)
|
|
2671
|
+
}),
|
|
2672
|
+
compileCardCss({ scheme: "dark", tone: "transparent" }),
|
|
2673
|
+
compileCardCss({ scheme: "dark", tone: "default" }),
|
|
2674
|
+
compileCardCss({ scheme: "dark", tone: "primary" }),
|
|
2675
|
+
compileCardCss({ scheme: "dark", tone: "positive" }),
|
|
2676
|
+
compileCardCss({ scheme: "dark", tone: "caution" }),
|
|
2677
|
+
compileCardCss({ scheme: "dark", tone: "critical" }),
|
|
2678
|
+
compileCardCss({ scheme: "light", tone: "transparent" }),
|
|
2679
|
+
compileCardCss({ scheme: "light", tone: "default" }),
|
|
2680
|
+
compileCardCss({ scheme: "light", tone: "primary" }),
|
|
2681
|
+
compileCardCss({ scheme: "light", tone: "positive" }),
|
|
2682
|
+
compileCardCss({ scheme: "light", tone: "caution" }),
|
|
2683
|
+
compileCardCss({ scheme: "light", tone: "critical" })
|
|
2684
|
+
].join(`
|
|
2685
|
+
|
|
2686
|
+
`);
|
|
2687
|
+
}
|
|
2688
|
+
function compileCardCss(props) {
|
|
2689
|
+
const { scheme, tone } = props, cardVars = vars.color[scheme][tone];
|
|
2690
|
+
return compileRule(`.card[data-scheme="${scheme}"][data-tone="${tone}"]`, {
|
|
2691
|
+
"--color-accent-fg": cardVars.accent.fg,
|
|
2692
|
+
...theme.THEME_COLOR_AVATAR_COLORS.reduce((acc, color) => ({
|
|
2693
|
+
...acc,
|
|
2694
|
+
[`--color-avatar-${color}-bg`]: cardVars.avatar[color].bg,
|
|
2695
|
+
[`--color-avatar-${color}-fg`]: cardVars.avatar[color].fg
|
|
2696
|
+
}), {}),
|
|
2697
|
+
"--color-backdrop": cardVars.backdrop,
|
|
2698
|
+
...theme.THEME_COLOR_STATE_TONES.reduce((acc, tone2) => ({
|
|
2699
|
+
...acc,
|
|
2700
|
+
[`--color-badge-${tone2}-bg`]: cardVars.badge[tone2].bg,
|
|
2701
|
+
[`--color-badge-${tone2}-dot`]: cardVars.badge[tone2].dot,
|
|
2702
|
+
[`--color-badge-${tone2}-fg`]: cardVars.badge[tone2].fg,
|
|
2703
|
+
[`--color-badge-${tone2}-icon`]: cardVars.badge[tone2].icon
|
|
2704
|
+
}), {}),
|
|
2705
|
+
"--color-bg": cardVars.bg,
|
|
2706
|
+
"--color-border": cardVars.border,
|
|
2707
|
+
// todo: button
|
|
2708
|
+
"--color-code-bg": cardVars.code.bg,
|
|
2709
|
+
"--color-code-fg": cardVars.code.fg,
|
|
2710
|
+
"--color-fg": cardVars.fg,
|
|
2711
|
+
"--color-focus-ring": cardVars.focusRing,
|
|
2712
|
+
"--color-icon": cardVars.icon,
|
|
2713
|
+
"--color-input-default-enabled-bg": cardVars.input.default.enabled.bg,
|
|
2714
|
+
"--color-input-default-enabled-border": cardVars.input.default.enabled.border,
|
|
2715
|
+
"--color-input-default-enabled-fg": cardVars.input.default.enabled.fg,
|
|
2716
|
+
"--color-input-default-enabled-muted-bg": cardVars.input.default.enabled.muted.bg,
|
|
2717
|
+
"--color-input-default-enabled-placeholder": cardVars.input.default.enabled.placeholder,
|
|
2718
|
+
"--color-input-default-hovered-bg": cardVars.input.default.hovered.bg,
|
|
2719
|
+
"--color-input-default-hovered-border": cardVars.input.default.hovered.border,
|
|
2720
|
+
"--color-input-default-hovered-fg": cardVars.input.default.hovered.fg,
|
|
2721
|
+
"--color-input-default-hovered-muted-bg": cardVars.input.default.hovered.muted.bg,
|
|
2722
|
+
"--color-input-default-hovered-placeholder": cardVars.input.default.hovered.placeholder,
|
|
2723
|
+
"--color-input-default-readOnly-bg": cardVars.input.default.readOnly.bg,
|
|
2724
|
+
"--color-input-default-readOnly-border": cardVars.input.default.readOnly.border,
|
|
2725
|
+
"--color-input-default-readOnly-fg": cardVars.input.default.readOnly.fg,
|
|
2726
|
+
"--color-input-default-readOnly-muted-bg": cardVars.input.default.readOnly.muted.bg,
|
|
2727
|
+
"--color-input-default-readOnly-placeholder": cardVars.input.default.readOnly.placeholder,
|
|
2728
|
+
"--color-input-default-disabled-bg": cardVars.input.default.disabled.bg,
|
|
2729
|
+
"--color-input-default-disabled-border": cardVars.input.default.disabled.border,
|
|
2730
|
+
"--color-input-default-disabled-fg": cardVars.input.default.disabled.fg,
|
|
2731
|
+
"--color-input-default-disabled-muted-bg": cardVars.input.default.disabled.muted.bg,
|
|
2732
|
+
"--color-input-default-disabled-placeholder": cardVars.input.default.disabled.placeholder,
|
|
2733
|
+
"--color-input-invalid-enabled-bg": cardVars.input.invalid.enabled.bg,
|
|
2734
|
+
"--color-input-invalid-enabled-border": cardVars.input.invalid.enabled.border,
|
|
2735
|
+
"--color-input-invalid-enabled-fg": cardVars.input.invalid.enabled.fg,
|
|
2736
|
+
"--color-input-invalid-enabled-muted-bg": cardVars.input.invalid.enabled.muted.bg,
|
|
2737
|
+
"--color-input-invalid-enabled-placeholder": cardVars.input.invalid.enabled.placeholder,
|
|
2738
|
+
"--color-input-invalid-hovered-bg": cardVars.input.invalid.hovered.bg,
|
|
2739
|
+
"--color-input-invalid-hovered-border": cardVars.input.invalid.hovered.border,
|
|
2740
|
+
"--color-input-invalid-hovered-fg": cardVars.input.invalid.hovered.fg,
|
|
2741
|
+
"--color-input-invalid-hovered-muted-bg": cardVars.input.invalid.hovered.muted.bg,
|
|
2742
|
+
"--color-input-invalid-hovered-placeholder": cardVars.input.invalid.hovered.placeholder,
|
|
2743
|
+
"--color-input-invalid-readOnly-bg": cardVars.input.invalid.readOnly.bg,
|
|
2744
|
+
"--color-input-invalid-readOnly-border": cardVars.input.invalid.readOnly.border,
|
|
2745
|
+
"--color-input-invalid-readOnly-fg": cardVars.input.invalid.readOnly.fg,
|
|
2746
|
+
"--color-input-invalid-readOnly-muted-bg": cardVars.input.invalid.readOnly.muted.bg,
|
|
2747
|
+
"--color-input-invalid-readOnly-placeholder": cardVars.input.invalid.readOnly.placeholder,
|
|
2748
|
+
"--color-input-invalid-disabled-bg": cardVars.input.invalid.disabled.bg,
|
|
2749
|
+
"--color-input-invalid-disabled-border": cardVars.input.invalid.disabled.border,
|
|
2750
|
+
"--color-input-invalid-disabled-fg": cardVars.input.invalid.disabled.fg,
|
|
2751
|
+
"--color-input-invalid-disabled-muted-bg": cardVars.input.invalid.disabled.muted.bg,
|
|
2752
|
+
"--color-input-invalid-disabled-placeholder": cardVars.input.invalid.disabled.placeholder,
|
|
2753
|
+
"--color-kbd-bg": cardVars.kbd.bg,
|
|
2754
|
+
"--color-kbd-border": cardVars.kbd.border,
|
|
2755
|
+
"--color-kbd-fg": cardVars.kbd.fg,
|
|
2756
|
+
"--color-link-fg": cardVars.link.fg,
|
|
2757
|
+
"--color-muted-bg": cardVars.muted.bg,
|
|
2758
|
+
"--color-muted-fg": cardVars.muted.fg,
|
|
2759
|
+
// todo: selectable
|
|
2760
|
+
"--color-shadow-outline": cardVars.shadow.outline,
|
|
2761
|
+
"--color-shadow-umbra": cardVars.shadow.umbra,
|
|
2762
|
+
"--color-shadow-penumbra": cardVars.shadow.penumbra,
|
|
2763
|
+
"--color-shadow-ambient": cardVars.shadow.outline,
|
|
2764
|
+
"--color-skeleton-from": cardVars.skeleton.from,
|
|
2765
|
+
"--color-skeleton-to": cardVars.skeleton.to,
|
|
2766
|
+
// todo: syntax
|
|
2767
|
+
"--color-syntax-atrule": cardVars.syntax.atrule,
|
|
2768
|
+
"--color-syntax-attrName": cardVars.syntax.attrName,
|
|
2769
|
+
"--color-syntax-attrValue": cardVars.syntax.attrValue,
|
|
2770
|
+
"--color-syntax-attribute": cardVars.syntax.attribute,
|
|
2771
|
+
"--color-syntax-boolean": cardVars.syntax.boolean,
|
|
2772
|
+
"--color-syntax-builtin": cardVars.syntax.builtin,
|
|
2773
|
+
"--color-syntax-cdata": cardVars.syntax.cdata,
|
|
2774
|
+
"--color-syntax-char": cardVars.syntax.char,
|
|
2775
|
+
"--color-syntax-class": cardVars.syntax.class,
|
|
2776
|
+
"--color-syntax-className": cardVars.syntax.className,
|
|
2777
|
+
"--color-syntax-comment": cardVars.syntax.comment,
|
|
2778
|
+
"--color-syntax-constant": cardVars.syntax.constant,
|
|
2779
|
+
"--color-syntax-deleted": cardVars.syntax.deleted,
|
|
2780
|
+
"--color-syntax-doctype": cardVars.syntax.doctype,
|
|
2781
|
+
"--color-syntax-entity": cardVars.syntax.entity,
|
|
2782
|
+
"--color-syntax-function": cardVars.syntax.function,
|
|
2783
|
+
"--color-syntax-hexcode": cardVars.syntax.hexcode,
|
|
2784
|
+
"--color-syntax-id": cardVars.syntax.id,
|
|
2785
|
+
"--color-syntax-important": cardVars.syntax.important,
|
|
2786
|
+
"--color-syntax-inserted": cardVars.syntax.inserted,
|
|
2787
|
+
"--color-syntax-keyword": cardVars.syntax.keyword,
|
|
2788
|
+
"--color-syntax-number": cardVars.syntax.number,
|
|
2789
|
+
"--color-syntax-operator": cardVars.syntax.operator,
|
|
2790
|
+
"--color-syntax-prolog": cardVars.syntax.prolog,
|
|
2791
|
+
"--color-syntax-property": cardVars.syntax.property,
|
|
2792
|
+
"--color-syntax-pseudoClass": cardVars.syntax.pseudoClass,
|
|
2793
|
+
"--color-syntax-pseudoElement": cardVars.syntax.pseudoElement,
|
|
2794
|
+
"--color-syntax-punctuation": cardVars.syntax.punctuation,
|
|
2795
|
+
"--color-syntax-regex": cardVars.syntax.regex,
|
|
2796
|
+
"--color-syntax-selector": cardVars.syntax.selector,
|
|
2797
|
+
"--color-syntax-string": cardVars.syntax.string,
|
|
2798
|
+
"--color-syntax-symbol": cardVars.syntax.symbol,
|
|
2799
|
+
"--color-syntax-tag": cardVars.syntax.tag,
|
|
2800
|
+
"--color-syntax-unit": cardVars.syntax.unit,
|
|
2801
|
+
"--color-syntax-url": cardVars.syntax.url,
|
|
2802
|
+
"--color-syntax-variable": cardVars.syntax.variable
|
|
2803
|
+
});
|
|
2804
|
+
}
|
|
2805
|
+
function getThemeEntries(obj, path2 = []) {
|
|
2806
|
+
const entries = [];
|
|
2807
|
+
if (isArray(obj))
|
|
2808
|
+
for (let i = 0; i < obj.length; i++) {
|
|
2809
|
+
const key = String(i), value = obj[i];
|
|
2810
|
+
isRecord(value) || isArray(value) ? entries.push(...getThemeEntries(value, [...path2, key])) : entries.push([`--${path2.concat(key).join("-")}`, value]);
|
|
2811
|
+
}
|
|
2812
|
+
else
|
|
2813
|
+
for (const [key, value] of Object.entries(obj))
|
|
2814
|
+
key.startsWith("_") || key !== "button" && key !== "selectable" && (isRecord(value) || isArray(value) ? entries.push(...getThemeEntries(value, [...path2, key])) : entries.push([`--${path2.concat(key).join("-")}`, value]));
|
|
2815
|
+
return entries;
|
|
2816
|
+
}
|
|
2817
|
+
function isRecord(value) {
|
|
2818
|
+
return value !== null && typeof value == "object" && !Array.isArray(value);
|
|
2819
|
+
}
|
|
2820
|
+
function isArray(value) {
|
|
2821
|
+
return Array.isArray(value);
|
|
2822
|
+
}
|
|
2823
|
+
async function buildSystem(outDir) {
|
|
2824
|
+
const css = compileSystem();
|
|
2825
|
+
await fs__default.default.mkdir(outDir, { recursive: !0 }), await fs__default.default.writeFile(path__default.default.resolve(outDir, "system.css"), css, "utf-8"), console.log("- system.css");
|
|
2826
|
+
}
|
|
2827
|
+
async function buildTheme(outDir) {
|
|
2828
|
+
const css = compileTheme(theme.buildTheme().v2);
|
|
2829
|
+
await fs__default.default.mkdir(outDir, { recursive: !0 }), await fs__default.default.writeFile(path__default.default.resolve(outDir, "sanity-theme.css"), css, "utf-8"), console.log("- sanity-theme.css");
|
|
2830
|
+
}
|
|
2831
|
+
async function buildCommand(options) {
|
|
2832
|
+
const cwd = options.cwd ?? process.cwd(), outDir = options.outDir ?? path__default.default.resolve(cwd, "dist");
|
|
2833
|
+
await buildSystem(outDir), await buildTheme(outDir);
|
|
2834
|
+
}
|
|
2835
|
+
exports.buildCommand = buildCommand;
|
|
2836
|
+
//# sourceMappingURL=buildCommand.js.map
|