@symbo.ls/scratch 0.7.31 → 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.31",
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 }
@@ -225,12 +225,9 @@ export const getMediaTheme = (val, mod) => {
225
225
  return
226
226
  }
227
227
 
228
- console.group(val)
229
-
230
228
  const [name, ...modifier] = isArray(val) ? val : val.split(' ')
231
229
  let value = CONFIG.THEME[name]
232
230
  if (value && (modifier || mod)) {
233
- console.log(value)
234
231
  value = findModifier(value, modifier.length ? modifier : mod)
235
232
  }
236
233