daisyui 4.2.1 → 4.2.2
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/package.json +1 -1
- package/src/theming/functions.js +4 -6
package/package.json
CHANGED
package/src/theming/functions.js
CHANGED
|
@@ -12,8 +12,7 @@ export function isDark(color) {
|
|
|
12
12
|
}
|
|
13
13
|
return false
|
|
14
14
|
}
|
|
15
|
-
export function colorObjToString(
|
|
16
|
-
const { l, c, h } = input
|
|
15
|
+
export function colorObjToString({ l, c, h }) {
|
|
17
16
|
return `${cutNumber(l)} ${cutNumber(c)} ${cutNumber(h)}`
|
|
18
17
|
}
|
|
19
18
|
export function generateForegroundColorFrom(input, percentage = 0.8) {
|
|
@@ -32,7 +31,7 @@ export function convertColorFormat(input) {
|
|
|
32
31
|
const resultObj = {}
|
|
33
32
|
|
|
34
33
|
Object.entries(input).forEach(([rule, value]) => {
|
|
35
|
-
if (
|
|
34
|
+
if (Object.hasOwn(colorNames, rule)) {
|
|
36
35
|
const colorObj = toGamutOKLCH(value)
|
|
37
36
|
resultObj[colorNames[rule]] = colorObjToString(colorObj)
|
|
38
37
|
} else {
|
|
@@ -114,15 +113,14 @@ export function convertColorFormat(input) {
|
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
// add css variables if not exist
|
|
117
|
-
Object.entries(variables).forEach((
|
|
118
|
-
const [variable, value] = item
|
|
116
|
+
Object.entries(variables).forEach(([variable, value]) => {
|
|
119
117
|
if (!Object.hasOwn(input, variable)) {
|
|
120
118
|
resultObj[variable] = value
|
|
121
119
|
}
|
|
122
120
|
})
|
|
123
121
|
|
|
124
122
|
// add other custom styles
|
|
125
|
-
if (!
|
|
123
|
+
if (!Object.hasOwn(colorNames, rule)) {
|
|
126
124
|
resultObj[rule] = value
|
|
127
125
|
}
|
|
128
126
|
})
|