@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @d0rich/esprit-design
2
2
 
3
+ ## 0.3.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 167fbab: Tailwind shadows plugin inherits colors from config
8
+
3
9
  ## 0.3.6
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d0rich/esprit-design",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -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
- for (const colorKey in colors) {
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 colors[colorKey] === 'string') {
70
+ if (typeof localColors[colorKey] === 'string') {
67
71
  result[`.ss-${colorKey}`] = {
68
- [COLOR_VAR]: colors[colorKey]
72
+ [COLOR_VAR]: localColors[colorKey]
69
73
  }
70
- } else if (typeof colors[colorKey] === 'object') {
71
- for (const colorVariantKey in colors[colorKey]) {
74
+ } else if (typeof localColors[colorKey] === 'object') {
75
+ for (const colorVariantKey in localColors[colorKey]) {
72
76
  result[`.ss-${colorKey}-${colorVariantKey}`] = {
73
- [COLOR_VAR]: colors[colorKey][colorVariantKey]
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
  })