@d0rich/esprit-design 0.3.6 → 0.3.7
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/plugins/shadows.js +13 -9
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/plugins/shadows.js
CHANGED
|
@@ -46,9 +46,13 @@ function generateDirections() {
|
|
|
46
46
|
return result
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
function generateColors() {
|
|
49
|
+
function generateColors(themeColors) {
|
|
50
50
|
const result = {}
|
|
51
|
-
|
|
51
|
+
const localColors = {
|
|
52
|
+
...colors,
|
|
53
|
+
...themeColors
|
|
54
|
+
}
|
|
55
|
+
for (const colorKey in localColors) {
|
|
52
56
|
if (
|
|
53
57
|
[
|
|
54
58
|
'inherit',
|
|
@@ -63,14 +67,14 @@ function generateColors() {
|
|
|
63
67
|
) {
|
|
64
68
|
continue
|
|
65
69
|
}
|
|
66
|
-
if (typeof
|
|
70
|
+
if (typeof localColors[colorKey] === 'string') {
|
|
67
71
|
result[`.ss-${colorKey}`] = {
|
|
68
|
-
[COLOR_VAR]:
|
|
72
|
+
[COLOR_VAR]: localColors[colorKey]
|
|
69
73
|
}
|
|
70
|
-
} else if (typeof
|
|
71
|
-
for (const colorVariantKey in
|
|
74
|
+
} else if (typeof localColors[colorKey] === 'object') {
|
|
75
|
+
for (const colorVariantKey in localColors[colorKey]) {
|
|
72
76
|
result[`.ss-${colorKey}-${colorVariantKey}`] = {
|
|
73
|
-
[COLOR_VAR]:
|
|
77
|
+
[COLOR_VAR]: localColors[colorKey][colorVariantKey]
|
|
74
78
|
}
|
|
75
79
|
}
|
|
76
80
|
}
|
|
@@ -78,10 +82,10 @@ function generateColors() {
|
|
|
78
82
|
return result
|
|
79
83
|
}
|
|
80
84
|
|
|
81
|
-
module.exports = plugin(function ({ addUtilities }) {
|
|
85
|
+
module.exports = plugin(function ({ addUtilities, config }) {
|
|
82
86
|
addUtilities({
|
|
83
87
|
'.sharp-shadow': defaultStyle,
|
|
84
88
|
...generateDirections(),
|
|
85
|
-
...generateColors()
|
|
89
|
+
...generateColors(config().theme.colors)
|
|
86
90
|
})
|
|
87
91
|
})
|