daisyui 5.7.4 → 5.7.6
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/base/properties.css +1 -1
- package/base/reset.css +1 -1
- package/base/rootcolor.css +1 -1
- package/base/rootscrollgutter.css +1 -1
- package/base/rootscrolllock.css +1 -1
- package/base/scrollbar.css +1 -1
- package/base/svg.css +1 -1
- package/colors/properties-extended.css +1 -1
- package/colors/properties.css +1 -1
- package/colors/responsive-extended.css +1 -1
- package/colors/responsive.css +1 -1
- package/colors/states-extended.css +1 -1
- package/colors/states.css +1 -1
- package/components/alert/object.js +1 -1
- package/components/alert.css +1 -1
- package/components/aura/object.js +1 -1
- package/components/aura.css +1 -1
- package/components/avatar/object.js +1 -1
- package/components/avatar.css +1 -1
- package/components/badge/object.js +1 -1
- package/components/badge.css +1 -1
- package/components/breadcrumbs/object.js +1 -1
- package/components/breadcrumbs.css +1 -1
- package/components/button/object.js +1 -1
- package/components/button.css +1 -1
- package/components/calendar/object.js +1 -1
- package/components/calendar.css +1 -1
- package/components/card/object.js +1 -1
- package/components/card.css +1 -1
- package/components/carousel/object.js +1 -1
- package/components/carousel.css +1 -1
- package/components/chat/object.js +1 -1
- package/components/chat.css +1 -1
- package/components/checkbox/object.js +1 -1
- package/components/checkbox.css +1 -1
- package/components/collapse/object.js +1 -1
- package/components/collapse.css +1 -1
- package/components/countdown/object.js +1 -1
- package/components/countdown.css +1 -1
- package/components/diff/object.js +1 -1
- package/components/diff.css +1 -1
- package/components/divider/object.js +1 -1
- package/components/divider.css +1 -1
- package/components/dock/object.js +1 -1
- package/components/dock.css +1 -1
- package/components/drawer/object.js +1 -1
- package/components/drawer.css +1 -1
- package/components/dropdown/object.js +1 -1
- package/components/dropdown.css +1 -1
- package/components/fab/object.js +1 -1
- package/components/fab.css +1 -1
- package/components/fieldset/object.js +1 -1
- package/components/fieldset.css +1 -1
- package/components/fileinput/object.js +1 -1
- package/components/fileinput.css +1 -1
- package/components/filter/object.js +1 -1
- package/components/filter.css +1 -1
- package/components/footer/object.js +1 -1
- package/components/footer.css +1 -1
- package/components/hero/object.js +1 -1
- package/components/hero.css +1 -1
- package/components/hover3d/object.js +1 -1
- package/components/hover3d.css +1 -1
- package/components/hovergallery/object.js +1 -1
- package/components/hovergallery.css +1 -1
- package/components/indicator/object.js +1 -1
- package/components/indicator.css +1 -1
- package/components/input/object.js +1 -1
- package/components/input.css +1 -1
- package/components/kbd/object.js +1 -1
- package/components/kbd.css +1 -1
- package/components/label/object.js +1 -1
- package/components/label.css +1 -1
- package/components/link/object.js +1 -1
- package/components/link.css +1 -1
- package/components/list/object.js +1 -1
- package/components/list.css +1 -1
- package/components/loading/object.js +1 -1
- package/components/loading.css +1 -1
- package/components/mask/object.js +1 -1
- package/components/mask.css +1 -1
- package/components/megamenu/object.js +1 -1
- package/components/megamenu.css +1 -1
- package/components/menu/object.js +1 -1
- package/components/menu.css +1 -1
- package/components/mockup/object.js +1 -1
- package/components/mockup.css +1 -1
- package/components/modal/object.js +1 -1
- package/components/modal.css +1 -1
- package/components/navbar/object.js +1 -1
- package/components/navbar.css +1 -1
- package/components/otp/object.js +1 -1
- package/components/otp.css +1 -1
- package/components/progress/object.js +1 -1
- package/components/progress.css +1 -1
- package/components/radialprogress/object.js +1 -1
- package/components/radialprogress.css +1 -1
- package/components/radio/object.js +1 -1
- package/components/radio.css +1 -1
- package/components/range/object.js +1 -1
- package/components/range.css +1 -1
- package/components/rating/object.js +1 -1
- package/components/rating.css +1 -1
- package/components/select/object.js +1 -1
- package/components/select.css +1 -1
- package/components/skeleton/object.js +1 -1
- package/components/skeleton.css +1 -1
- package/components/stack/object.js +1 -1
- package/components/stack.css +1 -1
- package/components/stat/object.js +1 -1
- package/components/stat.css +1 -1
- package/components/status/object.js +1 -1
- package/components/status.css +1 -1
- package/components/steps/object.js +1 -1
- package/components/steps.css +1 -1
- package/components/swap/object.js +1 -1
- package/components/swap.css +1 -1
- package/components/tab/object.js +1 -1
- package/components/tab.css +1 -1
- package/components/table/object.js +1 -1
- package/components/table.css +1 -1
- package/components/textarea/object.js +1 -1
- package/components/textarea.css +1 -1
- package/components/textrotate/object.js +1 -1
- package/components/textrotate.css +1 -1
- package/components/timeline/object.js +1 -1
- package/components/timeline.css +1 -1
- package/components/toast/object.js +1 -1
- package/components/toast.css +1 -1
- package/components/toggle/object.js +1 -1
- package/components/toggle.css +1 -1
- package/components/tooltip/object.js +1 -1
- package/components/tooltip.css +1 -1
- package/components/validator/object.js +1 -1
- package/components/validator.css +1 -1
- package/daisyui.css +1 -1
- package/functions/addPrefix.js +39 -36
- package/functions/nestCssLayers.js +43 -0
- package/functions/themeOrder.d.ts +2 -0
- package/functions/variables.d.ts +32 -0
- package/index.js +10 -3
- package/package.json +19 -1
- package/theme/index.js +11 -4
- package/theme/object.d.ts +16 -16
- package/theme/object.js +1 -1
- package/themes.css +1 -1
- package/utilities/glass.css +1 -1
- package/utilities/join.css +1 -1
- package/utilities/radius.css +1 -1
- package/utilities/typography.css +1 -1
package/functions/addPrefix.js
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
const defaultExcludedPrefixes = ["color-", "size-", "radius-", "border", "depth", "noise"]
|
|
2
|
-
const excludedSelectors = [
|
|
2
|
+
const excludedSelectors = [
|
|
3
|
+
"prose",
|
|
4
|
+
"is-hidden",
|
|
5
|
+
"is-bound",
|
|
6
|
+
"is-disabled",
|
|
7
|
+
"is-today",
|
|
8
|
+
"is-selected",
|
|
9
|
+
"has-event",
|
|
10
|
+
"is-inrange",
|
|
11
|
+
"is-startrange",
|
|
12
|
+
"is-endrange",
|
|
13
|
+
"is-outside-current-month",
|
|
14
|
+
"is-selection-disabled",
|
|
15
|
+
"pick-whole-week",
|
|
16
|
+
]
|
|
17
|
+
const shouldExcludeSelector = (selector) => {
|
|
18
|
+
const selectorName = selector.match(/^[\w-]+/)?.[0] || selector
|
|
19
|
+
return excludedSelectors.includes(selectorName) || /^(rdp|pika|vc)-/.test(selectorName)
|
|
20
|
+
}
|
|
3
21
|
|
|
4
22
|
const shouldExcludeVariable = (variableName, excludedPrefixes) => {
|
|
5
23
|
if (variableName.startsWith("tw")) {
|
|
@@ -17,47 +35,37 @@ const prefixVariable = (variableName, prefix, excludedPrefixes) => {
|
|
|
17
35
|
|
|
18
36
|
const getPrefixedSelector = (selector, prefix) => {
|
|
19
37
|
if (!selector.startsWith(".")) return selector
|
|
20
|
-
if (
|
|
38
|
+
if (shouldExcludeSelector(selector.slice(1))) return selector
|
|
21
39
|
return `.${prefix}${selector.slice(1)}`
|
|
22
40
|
}
|
|
23
41
|
|
|
24
42
|
const getPrefixedKey = (key, prefix, excludedPrefixes) => {
|
|
25
|
-
const prefixAmpDot = prefix ? `&.${prefix}` : ""
|
|
26
|
-
|
|
27
43
|
if (!prefix) return key
|
|
28
44
|
|
|
29
|
-
if (key.startsWith(".") &&
|
|
45
|
+
if (key.startsWith(".") && shouldExcludeSelector(key.slice(1))) return key
|
|
30
46
|
|
|
31
47
|
if (key.startsWith("--")) {
|
|
32
48
|
const variableName = key.slice(2)
|
|
33
49
|
return `--${prefixVariable(variableName, prefix, excludedPrefixes)}`
|
|
34
50
|
}
|
|
35
51
|
|
|
52
|
+
if (key.startsWith("@property --")) {
|
|
53
|
+
return processStringValue(key, prefix, excludedPrefixes)
|
|
54
|
+
}
|
|
55
|
+
|
|
36
56
|
if (key.startsWith("@") || key.startsWith("[")) {
|
|
37
57
|
return key
|
|
38
58
|
}
|
|
39
59
|
|
|
40
60
|
if (key.startsWith("&")) {
|
|
41
|
-
// If it's a complex selector with :not(), :has(), etc.
|
|
42
|
-
if (key.match(/:[a-z-]+\(/)) {
|
|
43
|
-
return key.replace(/\.([\w-]+)/g, (m, cls) =>
|
|
44
|
-
excludedSelectors.includes(cls) ? `.${cls}` : `.${prefix}${cls}`,
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
// For simple &. cases
|
|
48
|
-
if (key.startsWith("&.")) {
|
|
49
|
-
if (excludedSelectors.includes(key.slice(2))) return key
|
|
50
|
-
return `${prefixAmpDot}${key.slice(2)}`
|
|
51
|
-
}
|
|
52
|
-
// For other & cases (like &:hover or &:not(...))
|
|
53
61
|
return key.replace(/\.([\w-]+)/g, (m, cls) =>
|
|
54
|
-
|
|
62
|
+
shouldExcludeSelector(cls) ? `.${cls}` : `.${prefix}${cls}`,
|
|
55
63
|
)
|
|
56
64
|
}
|
|
57
65
|
|
|
58
66
|
if (key.startsWith(":")) {
|
|
59
67
|
return key.replace(/\.([\w-]+)/g, (m, cls) =>
|
|
60
|
-
|
|
68
|
+
shouldExcludeSelector(cls) ? `.${cls}` : `.${prefix}${cls}`,
|
|
61
69
|
)
|
|
62
70
|
}
|
|
63
71
|
|
|
@@ -68,12 +76,9 @@ const getPrefixedKey = (key, prefix, excludedPrefixes) => {
|
|
|
68
76
|
!key.includes("+") &&
|
|
69
77
|
!key.includes("~")
|
|
70
78
|
) {
|
|
71
|
-
return key
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
.map((part) => (excludedSelectors.includes(part) ? part : prefix + part))
|
|
75
|
-
.join(".")
|
|
76
|
-
.replace(/^/, ".")
|
|
79
|
+
return key.replace(/\.([\w-]+)/g, (m, cls) =>
|
|
80
|
+
shouldExcludeSelector(cls) ? `.${cls}` : `.${prefix}${cls}`,
|
|
81
|
+
)
|
|
77
82
|
}
|
|
78
83
|
|
|
79
84
|
if (key.includes(">") || key.includes("+") || key.includes("~")) {
|
|
@@ -84,7 +89,7 @@ const getPrefixedKey = (key, prefix, excludedPrefixes) => {
|
|
|
84
89
|
.map((part) => {
|
|
85
90
|
// Replace class names with prefixed versions for each part
|
|
86
91
|
return part.replace(/\.([\w-]+)/g, (m, cls) =>
|
|
87
|
-
|
|
92
|
+
shouldExcludeSelector(cls) ? `.${cls}` : `.${prefix}${cls}`,
|
|
88
93
|
)
|
|
89
94
|
})
|
|
90
95
|
.join(", ")
|
|
@@ -92,7 +97,7 @@ const getPrefixedKey = (key, prefix, excludedPrefixes) => {
|
|
|
92
97
|
|
|
93
98
|
// For simple combinators (not comma-separated)
|
|
94
99
|
let processedKey = key.replace(/\.([\w-]+)/g, (m, cls) =>
|
|
95
|
-
|
|
100
|
+
shouldExcludeSelector(cls) ? `.${cls}` : `.${prefix}${cls}`,
|
|
96
101
|
)
|
|
97
102
|
|
|
98
103
|
// Add a space before combinators at the beginning
|
|
@@ -112,9 +117,7 @@ const getPrefixedKey = (key, prefix, excludedPrefixes) => {
|
|
|
112
117
|
.split(/\s+/)
|
|
113
118
|
.map((part) => {
|
|
114
119
|
if (part.startsWith(".")) {
|
|
115
|
-
return
|
|
116
|
-
? part
|
|
117
|
-
: getPrefixedSelector(part, prefix)
|
|
120
|
+
return shouldExcludeSelector(part.slice(1)) ? part : getPrefixedSelector(part, prefix)
|
|
118
121
|
}
|
|
119
122
|
return part
|
|
120
123
|
})
|
|
@@ -124,15 +127,15 @@ const getPrefixedKey = (key, prefix, excludedPrefixes) => {
|
|
|
124
127
|
if (key.includes(":")) {
|
|
125
128
|
const [selector, ...pseudo] = key.split(":")
|
|
126
129
|
if (selector.startsWith(".")) {
|
|
127
|
-
return `${
|
|
130
|
+
return `${shouldExcludeSelector(selector.slice(1)) ? selector : getPrefixedSelector(selector, prefix)}:${pseudo.join(":")}`
|
|
128
131
|
}
|
|
129
132
|
return key.replace(/\.([\w-]+)/g, (m, cls) =>
|
|
130
|
-
|
|
133
|
+
shouldExcludeSelector(cls) ? `.${cls}` : `.${prefix}${cls}`,
|
|
131
134
|
)
|
|
132
135
|
}
|
|
133
136
|
|
|
134
137
|
if (key.startsWith(".")) {
|
|
135
|
-
return
|
|
138
|
+
return shouldExcludeSelector(key.slice(1)) ? key : getPrefixedSelector(key, prefix)
|
|
136
139
|
}
|
|
137
140
|
|
|
138
141
|
return key
|
|
@@ -142,7 +145,7 @@ const processArrayValue = (value, prefix, excludedPrefixes) => {
|
|
|
142
145
|
return value.map((item) => {
|
|
143
146
|
if (typeof item === "string") {
|
|
144
147
|
if (item.startsWith(".")) {
|
|
145
|
-
return
|
|
148
|
+
return shouldExcludeSelector(item.slice(1))
|
|
146
149
|
? item
|
|
147
150
|
: prefix
|
|
148
151
|
? `.${prefix}${item.slice(1)}`
|
|
@@ -154,14 +157,14 @@ const processArrayValue = (value, prefix, excludedPrefixes) => {
|
|
|
154
157
|
})
|
|
155
158
|
}
|
|
156
159
|
|
|
157
|
-
const reVariableName =
|
|
160
|
+
const reVariableName = /--([a-zA-Z0-9_-]+)/g
|
|
158
161
|
const processStringValue = (value, prefix, excludedPrefixes) => {
|
|
159
162
|
if (prefix === 0) return value
|
|
160
163
|
return value.replace(reVariableName, (match, variableName) => {
|
|
161
164
|
if (shouldExcludeVariable(variableName, excludedPrefixes)) {
|
|
162
165
|
return match
|
|
163
166
|
}
|
|
164
|
-
return
|
|
167
|
+
return `--${prefix}${variableName}`
|
|
165
168
|
})
|
|
166
169
|
}
|
|
167
170
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const appendRule = (styles, selector, rule) => {
|
|
2
|
+
const currentRule = styles[selector]
|
|
3
|
+
|
|
4
|
+
if (currentRule === undefined) {
|
|
5
|
+
styles[selector] = rule
|
|
6
|
+
return
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
styles[selector] = Array.isArray(currentRule) ? [...currentRule, rule] : [currentRule, rule]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const wrapWithAtRules = (rule, atRules) =>
|
|
13
|
+
atRules.reduceRight((wrappedRule, atRule) => ({ [atRule]: wrappedRule }), rule)
|
|
14
|
+
|
|
15
|
+
const moveLayerRules = (styles, layerValue, atRules) => {
|
|
16
|
+
const layerBlocks = Array.isArray(layerValue) ? layerValue : [layerValue]
|
|
17
|
+
|
|
18
|
+
for (const layerBlock of layerBlocks) {
|
|
19
|
+
for (const [key, value] of Object.entries(layerBlock)) {
|
|
20
|
+
if (key.startsWith("@")) {
|
|
21
|
+
moveLayerRules(styles, value, [...atRules, key])
|
|
22
|
+
continue
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
appendRule(styles, key, wrapWithAtRules(value, atRules))
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const nestCssLayers = (styles) => {
|
|
31
|
+
const nestedStyles = {}
|
|
32
|
+
|
|
33
|
+
for (const [key, value] of Object.entries(styles)) {
|
|
34
|
+
if (key.startsWith("@layer ")) {
|
|
35
|
+
moveLayerRules(nestedStyles, value, [key])
|
|
36
|
+
continue
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
appendRule(nestedStyles, key, value)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return nestedStyles
|
|
43
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare module 'daisyui/functions/variables' {
|
|
2
|
+
const variables: {
|
|
3
|
+
colors: {
|
|
4
|
+
"base-100": string;
|
|
5
|
+
"base-200": string;
|
|
6
|
+
"base-300": string;
|
|
7
|
+
"base-content": string;
|
|
8
|
+
primary: string;
|
|
9
|
+
"primary-content": string;
|
|
10
|
+
secondary: string;
|
|
11
|
+
"secondary-content": string;
|
|
12
|
+
accent: string;
|
|
13
|
+
"accent-content": string;
|
|
14
|
+
neutral: string;
|
|
15
|
+
"neutral-content": string;
|
|
16
|
+
info: string;
|
|
17
|
+
"info-content": string;
|
|
18
|
+
success: string;
|
|
19
|
+
"success-content": string;
|
|
20
|
+
warning: string;
|
|
21
|
+
"warning-content": string;
|
|
22
|
+
error: string;
|
|
23
|
+
"error-content": string;
|
|
24
|
+
};
|
|
25
|
+
borderRadius: {
|
|
26
|
+
selector: string;
|
|
27
|
+
field: string;
|
|
28
|
+
box: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export default variables;
|
|
32
|
+
}
|
package/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
const version = "5.7.
|
|
1
|
+
const version = "5.7.6"
|
|
2
2
|
import { pluginOptionsHandler } from "./functions/pluginOptionsHandler.js"
|
|
3
3
|
import { plugin } from "./functions/plugin.js"
|
|
4
|
+
import { nestCssLayers } from "./functions/nestCssLayers.js"
|
|
4
5
|
import variables from "./functions/variables.js"
|
|
5
6
|
import themesObject from "./theme/object.js"
|
|
6
7
|
import { base, components, utilities } from "./imports.js"
|
|
@@ -34,12 +35,18 @@ export default plugin.withOptions(
|
|
|
34
35
|
|
|
35
36
|
Object.entries(components).forEach(([name, item]) => {
|
|
36
37
|
if (!shouldIncludeItem(name)) return
|
|
37
|
-
item({
|
|
38
|
+
item({
|
|
39
|
+
addComponents: (styles) => addComponents(nestCssLayers(styles)),
|
|
40
|
+
prefix,
|
|
41
|
+
})
|
|
38
42
|
})
|
|
39
43
|
|
|
40
44
|
Object.entries(utilities).forEach(([name, item]) => {
|
|
41
45
|
if (!shouldIncludeItem(name)) return
|
|
42
|
-
item({
|
|
46
|
+
item({
|
|
47
|
+
addUtilities: (styles) => addUtilities(nestCssLayers(styles)),
|
|
48
|
+
prefix,
|
|
49
|
+
})
|
|
43
50
|
})
|
|
44
51
|
|
|
45
52
|
// drawer variants. Can not be nested in layers so defined here
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "daisyui",
|
|
4
|
-
"version": "5.7.
|
|
4
|
+
"version": "5.7.6",
|
|
5
5
|
"description": "daisyUI 5 - The Tailwind CSS Component Library",
|
|
6
6
|
"author": "Pouya Saadeghi",
|
|
7
7
|
"license": "MIT",
|
|
@@ -50,6 +50,21 @@
|
|
|
50
50
|
"browser": "./daisyui.css",
|
|
51
51
|
"exports": {
|
|
52
52
|
".": "./index.js",
|
|
53
|
+
"./theme": {
|
|
54
|
+
"default": "./theme/index.js"
|
|
55
|
+
},
|
|
56
|
+
"./theme/object": {
|
|
57
|
+
"types": "./theme/object.d.ts",
|
|
58
|
+
"default": "./theme/object.js"
|
|
59
|
+
},
|
|
60
|
+
"./functions/themeOrder": {
|
|
61
|
+
"types": "./functions/themeOrder.d.ts",
|
|
62
|
+
"default": "./functions/themeOrder.js"
|
|
63
|
+
},
|
|
64
|
+
"./functions/variables": {
|
|
65
|
+
"types": "./functions/variables.d.ts",
|
|
66
|
+
"default": "./functions/variables.js"
|
|
67
|
+
},
|
|
53
68
|
"./*": "./*"
|
|
54
69
|
},
|
|
55
70
|
"files": [
|
|
@@ -58,10 +73,13 @@
|
|
|
58
73
|
"components",
|
|
59
74
|
"!components/*/class.json",
|
|
60
75
|
"functions/addPrefix.js",
|
|
76
|
+
"functions/nestCssLayers.js",
|
|
61
77
|
"functions/plugin.js",
|
|
62
78
|
"functions/pluginOptionsHandler.js",
|
|
63
79
|
"functions/themeOrder.js",
|
|
80
|
+
"functions/themeOrder.d.ts",
|
|
64
81
|
"functions/variables.js",
|
|
82
|
+
"functions/variables.d.ts",
|
|
65
83
|
"theme",
|
|
66
84
|
"utilities",
|
|
67
85
|
"imports.js",
|
package/theme/index.js
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import { plugin } from "../functions/plugin.js"
|
|
2
2
|
import allThemes from "./object.js"
|
|
3
3
|
|
|
4
|
+
const escapeCssString = (value) =>
|
|
5
|
+
String(value).replace(
|
|
6
|
+
/[^a-zA-Z0-9_-]/gu,
|
|
7
|
+
(character) => `\\${character.codePointAt(0).toString(16)} `,
|
|
8
|
+
)
|
|
9
|
+
|
|
4
10
|
export default plugin.withOptions((options = {}) => {
|
|
5
11
|
return ({ addBase }) => {
|
|
6
12
|
const {
|
|
7
13
|
name = "custom-theme",
|
|
8
14
|
default: isDefault = false,
|
|
9
15
|
prefersdark = false,
|
|
10
|
-
"color-scheme": colorScheme
|
|
16
|
+
"color-scheme": colorScheme,
|
|
11
17
|
root = ":root",
|
|
12
18
|
...customThemeTokens
|
|
13
19
|
} = options
|
|
14
20
|
|
|
15
|
-
|
|
21
|
+
const escapedName = escapeCssString(name)
|
|
22
|
+
let selector = `${root}:has(input.theme-controller[value="${escapedName}"]:checked),[data-theme="${escapedName}"]`
|
|
16
23
|
if (isDefault) {
|
|
17
24
|
selector = `:where(${root}),${selector}`
|
|
18
25
|
}
|
|
@@ -24,13 +31,13 @@ export default plugin.withOptions((options = {}) => {
|
|
|
24
31
|
themeTokens = {
|
|
25
32
|
...builtinTheme,
|
|
26
33
|
...customThemeTokens,
|
|
27
|
-
"color-scheme": colorScheme
|
|
34
|
+
"color-scheme": colorScheme ?? builtinTheme["color-scheme"],
|
|
28
35
|
}
|
|
29
36
|
}
|
|
30
37
|
|
|
31
38
|
const baseStyles = {
|
|
32
39
|
[selector]: {
|
|
33
|
-
"color-scheme": themeTokens["color-scheme"]
|
|
40
|
+
"color-scheme": themeTokens["color-scheme"] ?? colorScheme ?? "normal",
|
|
34
41
|
...themeTokens,
|
|
35
42
|
},
|
|
36
43
|
}
|
package/theme/object.d.ts
CHANGED
|
@@ -33,39 +33,39 @@ interface Theme {
|
|
|
33
33
|
|
|
34
34
|
interface Themes {
|
|
35
35
|
black: Theme
|
|
36
|
-
silk: Theme
|
|
37
|
-
halloween: Theme
|
|
38
|
-
forest: Theme
|
|
39
|
-
retro: Theme
|
|
40
36
|
light: Theme
|
|
41
37
|
lemonade: Theme
|
|
42
|
-
caramellatte: Theme
|
|
43
|
-
nord: Theme
|
|
44
38
|
fantasy: Theme
|
|
45
39
|
autumn: Theme
|
|
46
40
|
corporate: Theme
|
|
47
41
|
cupcake: Theme
|
|
48
42
|
night: Theme
|
|
49
|
-
abyss: Theme
|
|
50
43
|
synthwave: Theme
|
|
44
|
+
abyss: Theme
|
|
51
45
|
dim: Theme
|
|
52
46
|
bumblebee: Theme
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
caramellatte: Theme
|
|
48
|
+
silk: Theme
|
|
49
|
+
forest: Theme
|
|
50
|
+
halloween: Theme
|
|
51
|
+
retro: Theme
|
|
52
|
+
nord: Theme
|
|
55
53
|
dark: Theme
|
|
54
|
+
sunset: Theme
|
|
56
55
|
aqua: Theme
|
|
57
|
-
wireframe: Theme
|
|
58
56
|
acid: Theme
|
|
59
|
-
|
|
60
|
-
cmyk: Theme
|
|
61
|
-
sunset: Theme
|
|
57
|
+
wireframe: Theme
|
|
62
58
|
emerald: Theme
|
|
59
|
+
cmyk: Theme
|
|
63
60
|
dracula: Theme
|
|
64
|
-
lofi: Theme
|
|
65
|
-
garden: Theme
|
|
66
|
-
business: Theme
|
|
67
61
|
pastel: Theme
|
|
62
|
+
cyberpunk: Theme
|
|
63
|
+
business: Theme
|
|
64
|
+
garden: Theme
|
|
65
|
+
lofi: Theme
|
|
68
66
|
coffee: Theme
|
|
67
|
+
luxury: Theme
|
|
68
|
+
winter: Theme
|
|
69
69
|
valentine: Theme
|
|
70
70
|
[key: string]: Theme
|
|
71
71
|
}
|