@symbo.ls/scratch 0.3.11 → 0.3.12
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 +3 -3
- package/src/methods/set.js +8 -8
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@symbo.ls/scratch",
|
|
3
3
|
"description": "Φ / CSS framework and methodology.",
|
|
4
4
|
"author": "Symbols",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.12",
|
|
6
6
|
"files": [
|
|
7
7
|
"src"
|
|
8
8
|
],
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"bump": "npx np"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@babel/core": "^7.
|
|
23
|
-
"@babel/preset-env": "^7.
|
|
22
|
+
"@babel/core": "^7.0.0-0",
|
|
23
|
+
"@babel/preset-env": "^7.18.9",
|
|
24
24
|
"babel-eslint": "^10.0.3",
|
|
25
25
|
"babel-jest": "^27.0.2",
|
|
26
26
|
"babel-preset-env": "^1.7.0",
|
package/src/methods/set.js
CHANGED
|
@@ -14,16 +14,14 @@ import {
|
|
|
14
14
|
getDefaultOrFirstKey,
|
|
15
15
|
getFontFaceEach,
|
|
16
16
|
hslToRgb,
|
|
17
|
-
getColorShade
|
|
18
|
-
pSBC,
|
|
19
|
-
changeLightness
|
|
17
|
+
getColorShade
|
|
20
18
|
} from '../utils'
|
|
21
19
|
|
|
22
20
|
const ENV = process.env.NODE_ENV
|
|
23
21
|
|
|
24
22
|
export const getColor = value => {
|
|
25
23
|
if (!isString(value)) {
|
|
26
|
-
if (ENV === 'test' || ENV === 'development') console.warn(value, '- type for color is not valid')
|
|
24
|
+
if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose) console.warn(value, '- type for color is not valid')
|
|
27
25
|
return
|
|
28
26
|
}
|
|
29
27
|
|
|
@@ -32,7 +30,7 @@ export const getColor = value => {
|
|
|
32
30
|
const val = COLOR[name] || GRADIENT[name]
|
|
33
31
|
|
|
34
32
|
if (!val) {
|
|
35
|
-
if (ENV === 'test' || ENV === 'development') console.warn('Can\'t find color', name)
|
|
33
|
+
if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose) console.warn('Can\'t find color', name)
|
|
36
34
|
return value
|
|
37
35
|
}
|
|
38
36
|
|
|
@@ -49,7 +47,7 @@ export const getColor = value => {
|
|
|
49
47
|
} else {
|
|
50
48
|
const [r, g, b] = [...rgb.split(', ').map(v => parseFloat(v))]
|
|
51
49
|
const hsl = rgbToHSL(r, g, b)
|
|
52
|
-
const [h, s, l] = hsl
|
|
50
|
+
const [h, s, l] = hsl // eslint-disable-line
|
|
53
51
|
const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255)
|
|
54
52
|
rgb = newRgb
|
|
55
53
|
}
|
|
@@ -117,7 +115,7 @@ export const getTheme = value => {
|
|
|
117
115
|
} else if (isObject(value)) return setThemeValue(value)
|
|
118
116
|
else if (isString(value) && THEME[value]) return getThemeValue(THEME[value])
|
|
119
117
|
|
|
120
|
-
if (ENV === 'test' || ENV === 'development') console.warn('Can\'t find theme', value)
|
|
118
|
+
if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose) console.warn('Can\'t find theme', value)
|
|
121
119
|
}
|
|
122
120
|
|
|
123
121
|
const setPrefersScheme = (theme, key, variant, themeValue) => {
|
|
@@ -254,7 +252,7 @@ export const setEach = (factoryName, props) => {
|
|
|
254
252
|
}
|
|
255
253
|
|
|
256
254
|
export const set = recivedConfig => {
|
|
257
|
-
const { version, ...config } = recivedConfig
|
|
255
|
+
const { version, verbose, ...config } = recivedConfig
|
|
258
256
|
const keys = Object.keys(config)
|
|
259
257
|
keys.map(key => setEach(key, config[key]))
|
|
260
258
|
|
|
@@ -263,6 +261,8 @@ export const set = recivedConfig => {
|
|
|
263
261
|
applySpacingSequence()
|
|
264
262
|
applyDocument()
|
|
265
263
|
|
|
264
|
+
CONFIG.verbose = verbose
|
|
265
|
+
|
|
266
266
|
console.log(CONFIG)
|
|
267
267
|
return CONFIG
|
|
268
268
|
}
|