@symbo.ls/scratch 0.7.5 → 0.7.6

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.5",
5
+ "version": "0.7.6",
6
6
  "files": [
7
7
  "src"
8
8
  ],
package/src/set.js CHANGED
@@ -54,7 +54,7 @@ export const setValue = (FACTORY_NAME, value, key) => {
54
54
  const result = SETTERS[factoryName](value, key)
55
55
 
56
56
  // console.log(CONFIG.verbose)
57
- if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose && FACTORY[key]) {
57
+ if (CONFIG.verbose && FACTORY[key]) {
58
58
  // console.warn('Replacing ', key, ' as ', FACTORY[key], ' in ', factoryName)
59
59
  }
60
60
 
@@ -78,7 +78,7 @@ export const set = recivedConfig => {
78
78
  if (verbose !== undefined) CONFIG.verbose = verbose
79
79
  if (useVariable !== undefined) CONFIG.useVariable = useVariable
80
80
  if (useReset !== undefined) CONFIG.useReset = useReset
81
- if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose) console.log(CONFIG)
81
+ if (CONFIG.verbose) console.log(CONFIG)
82
82
 
83
83
  const keys = Object.keys(config)
84
84
  keys.map(key => setEach(key, config[key]))
@@ -15,11 +15,9 @@ import {
15
15
  isObject
16
16
  } from '../utils'
17
17
 
18
- const ENV = process.env.NODE_ENV
19
-
20
18
  export const getColor = (value, key) => {
21
19
  if (!isString(value)) {
22
- if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose) console.warn(value, '- type for color is not valid')
20
+ if (CONFIG.verbose) console.warn(value, '- type for color is not valid')
23
21
  return
24
22
  }
25
23
 
@@ -32,13 +30,13 @@ export const getColor = (value, key) => {
32
30
  let val = (COLOR[name] || GRADIENT[name])
33
31
 
34
32
  if (!val) {
35
- if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose) console.warn('Can\'t find color ', name)
33
+ if (CONFIG.verbose) console.warn('Can\'t find color ', name)
36
34
  return value
37
35
  }
38
36
 
39
37
  if (key) {
40
38
  if (val[key]) val = val[key]
41
- else if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose) console.warn(value, ' - does not have ', key)
39
+ else if (CONFIG.verbose) console.warn(value, ' - does not have ', key)
42
40
  }
43
41
 
44
42
  // TODO: support variables
@@ -68,7 +66,7 @@ export const getColor = (value, key) => {
68
66
 
69
67
  export const getMediaColor = (value, param) => {
70
68
  if (!isString(value)) {
71
- if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose) console.warn(value, '- type for color is not valid')
69
+ if (CONFIG.verbose) console.warn(value, '- type for color is not valid')
72
70
  return
73
71
  }
74
72
 
@@ -90,7 +88,7 @@ export const getMediaColor = (value, param) => {
90
88
  }
91
89
  return obj
92
90
  } else {
93
- if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose) console.warn('Can\'t find color', value)
91
+ if (CONFIG.verbose) console.warn('Can\'t find color', value)
94
92
  return { [param]: value }
95
93
  }
96
94
  }
@@ -53,7 +53,7 @@ export const getTheme = (value, modifier) => {
53
53
  if (state && state[subThemeName]) return getThemeValue(state[subThemeName])
54
54
  } else if (isObject(value)) return setThemeValue(value)
55
55
 
56
- // if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose) console.warn('Can\'t find theme', value)
56
+ // if (CONFIG.verbose) console.warn('Can\'t find theme', value)
57
57
  }
58
58
 
59
59
  const setInverseTheme = (theme, variant, value) => {
@@ -225,7 +225,7 @@ export const getMediaTheme = (val, mod, themeObj) => {
225
225
  if (isString(val) && val.slice(0, 2) === '--') val = getMediaTheme(val.slice(2))
226
226
 
227
227
  if (!val || !isString(val)) {
228
- if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose) console.warn(val, '- theme is not string')
228
+ if (CONFIG.verbose) console.warn(val, '- theme is not string')
229
229
  return
230
230
  }
231
231
 
package/src/utils/var.js CHANGED
@@ -31,7 +31,7 @@ export const applySequenceVars = (props, mediaName, options = {}) => {
31
31
  if (mediaName) {
32
32
  const query = MEDIA[mediaName]
33
33
  if (!query) {
34
- if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose) console.warn('Can\'t find query ', query)
34
+ if (CONFIG.verbose) console.warn('Can\'t find query ', query)
35
35
  }
36
36
  let underMediaQuery = CSS_VARS[`@media ${query}`]
37
37
  if (!underMediaQuery) underMediaQuery = CSS_VARS[`@media ${query}`] = {}