@symbo.ls/scratch 0.6.3 → 0.6.4
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 +1 -1
- package/src/config/index.js +1 -0
- package/src/config/responsive.js +1 -1
- package/src/system/color.js +2 -0
- package/src/utils/sequence.js +9 -2
package/package.json
CHANGED
package/src/config/index.js
CHANGED
package/src/config/responsive.js
CHANGED
package/src/system/color.js
CHANGED
|
@@ -23,6 +23,8 @@ export const getColor = (value, key) => {
|
|
|
23
23
|
return
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
if (value.slice(0, 2) === '--') return `var(${value})`
|
|
27
|
+
|
|
26
28
|
if (key && value[key]) value = value[key]
|
|
27
29
|
const [name, alpha, tone] = isArray(value) ? value : value.split(' ')
|
|
28
30
|
const { COLOR, GRADIENT } = CONFIG
|
package/src/utils/sequence.js
CHANGED
|
@@ -45,7 +45,14 @@ const setSequenceValue = ({ key, variable, value, scaling, state, index }) => {
|
|
|
45
45
|
state.vars[variable] = scaling + state.unit
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export const getSequenceValue = ({
|
|
48
|
+
export const getSequenceValue = ({
|
|
49
|
+
type,
|
|
50
|
+
prop,
|
|
51
|
+
val = 'A',
|
|
52
|
+
prefix = '--font-size-',
|
|
53
|
+
unit = UNIT.default,
|
|
54
|
+
useVariable
|
|
55
|
+
}) => {
|
|
49
56
|
if (typeof val !== 'string') console.warn(prop, val, 'is not a string')
|
|
50
57
|
|
|
51
58
|
if (val === '-' || val === '') return ({ })
|
|
@@ -74,7 +81,7 @@ export const getSequenceValue = ({ type, prop, val = 'A', prefix = '--font-size-
|
|
|
74
81
|
const value = type ? type[pureVal] : null
|
|
75
82
|
if (!value) return console.warn('can\'t find', type, pureVal)
|
|
76
83
|
|
|
77
|
-
if (CONFIG.useVariable) {
|
|
84
|
+
if (useVariable || CONFIG.useVariable) {
|
|
78
85
|
const varVal = `var(${prefix}${pureVal}${mediaName})`
|
|
79
86
|
return isNegative ? {
|
|
80
87
|
[prop]: `calc(${varVal} * -1)`
|