@symbo.ls/scratch 0.7.32 → 0.7.33

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 CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@symbo.ls/scratch",
3
3
  "description": "Φ / CSS framework and methodology.",
4
4
  "author": "symbo.ls",
5
- "version": "0.7.32",
5
+ "version": "0.7.33",
6
6
  "files": [
7
7
  "src"
8
8
  ],
@@ -1,5 +1,6 @@
1
1
  'use strict'
2
2
 
3
+ import { logGroupIf } from '@domql/utils'
3
4
  import { MEDIA } from '../defaultConfig'
4
5
  import { CONFIG, CSS_VARS } from '../factory' // eslint-disable-line
5
6
 
@@ -76,17 +77,22 @@ export const getMediaColor = (value, property, globalTheme = CONFIG.globalTheme)
76
77
 
77
78
  const { COLOR, GRADIENT } = CONFIG
78
79
  const val = COLOR[name] || GRADIENT[name]
79
-
80
80
  const isObj = isObject(val)
81
+
81
82
  if (isObj && val.value) return { [property]: getColor(value, globalTheme) }
82
83
  else if (isObj) {
83
- const obj = {}
84
- for (const mediaName in val) {
85
- const query = MEDIA[globalTheme || mediaName.slice(1)]
86
- const media = `@media screen and ${query}`
87
- obj[media] = { [property]: getColor(value, globalTheme || mediaName) }
84
+ if (globalTheme) {
85
+ logGroupIf(name === 'packageGradient', name, val, globalTheme)
86
+ return { [property]: getColor(value, `@${globalTheme}`) }
87
+ } else {
88
+ const obj = {}
89
+ for (const mediaName in val) {
90
+ const query = MEDIA[mediaName.slice(1)]
91
+ const media = `@media screen and ${query}`
92
+ obj[media] = { [property]: getColor(value, mediaName) }
93
+ }
94
+ return obj
88
95
  }
89
- return obj
90
96
  } else {
91
97
  if (CONFIG.verbose) console.warn('Can\'t find color', value)
92
98
  return { [property]: value }