@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 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.6.3",
5
+ "version": "0.6.4",
6
6
  "files": [
7
7
  "src"
8
8
  ],
@@ -14,6 +14,7 @@ export * from './theme'
14
14
  export * from './icons'
15
15
  export * from './timing'
16
16
  export * from './document'
17
+ export * from './responsive'
17
18
  export * from './cases'
18
19
 
19
20
  export const RESET = {}
@@ -2,7 +2,7 @@
2
2
 
3
3
  export const BREAKPOINTS = {
4
4
  screenL: 1920,
5
- screenD: 1680,
5
+ screenM: 1680,
6
6
  screenS: 1440,
7
7
  tabletL: 1366,
8
8
  tabletM: 1280,
@@ -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
@@ -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 = ({ type, prop, val = 'A', prefix = '--font-size-', unit = UNIT.default }) => {
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)`