@symbo.ls/scratch 3.6.7 → 3.7.0

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.
Files changed (107) hide show
  1. package/dist/cjs/defaultConfig/animation.js +2 -2
  2. package/dist/cjs/defaultConfig/cases.js +2 -2
  3. package/dist/cjs/defaultConfig/color.js +4 -4
  4. package/dist/cjs/defaultConfig/document.js +2 -2
  5. package/dist/cjs/defaultConfig/font-family.js +6 -6
  6. package/dist/cjs/defaultConfig/font.js +2 -2
  7. package/dist/cjs/defaultConfig/grid.js +2 -2
  8. package/dist/cjs/defaultConfig/icons.js +4 -4
  9. package/dist/cjs/defaultConfig/index.js +2 -2
  10. package/dist/cjs/defaultConfig/media.js +2 -2
  11. package/dist/cjs/defaultConfig/responsive.js +4 -4
  12. package/dist/cjs/defaultConfig/sequence.js +2 -2
  13. package/dist/cjs/defaultConfig/shadow.js +2 -7
  14. package/dist/cjs/defaultConfig/spacing.js +4 -4
  15. package/dist/cjs/defaultConfig/svg.js +4 -4
  16. package/dist/cjs/defaultConfig/templates.js +2 -2
  17. package/dist/cjs/defaultConfig/theme.js +2 -2
  18. package/dist/cjs/defaultConfig/timing.js +3 -3
  19. package/dist/cjs/defaultConfig/typography.js +3 -3
  20. package/dist/cjs/defaultConfig/unit.js +2 -2
  21. package/dist/cjs/factory.js +6 -0
  22. package/dist/cjs/set.js +8 -4
  23. package/dist/cjs/system/color.js +4 -4
  24. package/dist/cjs/system/document.js +1 -1
  25. package/dist/cjs/system/font.js +2 -2
  26. package/dist/cjs/system/reset.js +2 -2
  27. package/dist/cjs/system/shadow.js +2 -2
  28. package/dist/cjs/system/spacing.js +3 -3
  29. package/dist/cjs/system/svg.js +5 -5
  30. package/dist/cjs/system/theme.js +4 -4
  31. package/dist/cjs/system/timing.js +3 -3
  32. package/dist/cjs/system/typography.js +3 -3
  33. package/dist/cjs/transforms/index.js +1 -1
  34. package/dist/cjs/utils/sequence.js +1 -1
  35. package/dist/cjs/utils/var.js +3 -3
  36. package/dist/esm/defaultConfig/animation.js +2 -2
  37. package/dist/esm/defaultConfig/cases.js +2 -2
  38. package/dist/esm/defaultConfig/color.js +4 -4
  39. package/dist/esm/defaultConfig/document.js +2 -2
  40. package/dist/esm/defaultConfig/font-family.js +6 -6
  41. package/dist/esm/defaultConfig/font.js +2 -2
  42. package/dist/esm/defaultConfig/grid.js +2 -2
  43. package/dist/esm/defaultConfig/icons.js +4 -4
  44. package/dist/esm/defaultConfig/index.js +2 -2
  45. package/dist/esm/defaultConfig/media.js +2 -2
  46. package/dist/esm/defaultConfig/responsive.js +4 -4
  47. package/dist/esm/defaultConfig/sequence.js +2 -2
  48. package/dist/esm/defaultConfig/shadow.js +2 -7
  49. package/dist/esm/defaultConfig/spacing.js +6 -6
  50. package/dist/esm/defaultConfig/svg.js +4 -4
  51. package/dist/esm/defaultConfig/templates.js +2 -2
  52. package/dist/esm/defaultConfig/theme.js +2 -2
  53. package/dist/esm/defaultConfig/timing.js +4 -4
  54. package/dist/esm/defaultConfig/typography.js +4 -4
  55. package/dist/esm/defaultConfig/unit.js +2 -2
  56. package/dist/esm/factory.js +6 -0
  57. package/dist/esm/set.js +8 -4
  58. package/dist/esm/system/color.js +4 -4
  59. package/dist/esm/system/document.js +1 -1
  60. package/dist/esm/system/font.js +2 -2
  61. package/dist/esm/system/reset.js +2 -2
  62. package/dist/esm/system/shadow.js +2 -2
  63. package/dist/esm/system/spacing.js +3 -3
  64. package/dist/esm/system/svg.js +5 -5
  65. package/dist/esm/system/theme.js +4 -4
  66. package/dist/esm/system/timing.js +3 -3
  67. package/dist/esm/system/typography.js +3 -3
  68. package/dist/esm/transforms/index.js +1 -1
  69. package/dist/esm/utils/sequence.js +1 -1
  70. package/dist/esm/utils/var.js +3 -3
  71. package/dist/iife/index.js +335 -325
  72. package/package.json +3 -3
  73. package/src/defaultConfig/animation.js +1 -1
  74. package/src/defaultConfig/cases.js +1 -1
  75. package/src/defaultConfig/color.js +2 -2
  76. package/src/defaultConfig/document.js +1 -1
  77. package/src/defaultConfig/font-family.js +3 -3
  78. package/src/defaultConfig/font.js +1 -1
  79. package/src/defaultConfig/grid.js +1 -1
  80. package/src/defaultConfig/icons.js +2 -2
  81. package/src/defaultConfig/index.js +1 -1
  82. package/src/defaultConfig/media.js +1 -1
  83. package/src/defaultConfig/responsive.js +2 -2
  84. package/src/defaultConfig/sequence.js +1 -1
  85. package/src/defaultConfig/shadow.js +1 -6
  86. package/src/defaultConfig/spacing.js +5 -5
  87. package/src/defaultConfig/svg.js +2 -2
  88. package/src/defaultConfig/templates.js +1 -1
  89. package/src/defaultConfig/theme.js +1 -1
  90. package/src/defaultConfig/timing.js +3 -3
  91. package/src/defaultConfig/typography.js +3 -3
  92. package/src/defaultConfig/unit.js +1 -1
  93. package/src/factory.js +10 -2
  94. package/src/set.js +8 -4
  95. package/src/system/color.js +4 -4
  96. package/src/system/document.js +1 -1
  97. package/src/system/font.js +2 -2
  98. package/src/system/reset.js +2 -2
  99. package/src/system/shadow.js +2 -2
  100. package/src/system/spacing.js +3 -3
  101. package/src/system/svg.js +5 -5
  102. package/src/system/theme.js +6 -4
  103. package/src/system/timing.js +3 -3
  104. package/src/system/typography.js +3 -3
  105. package/src/transforms/index.js +1 -1
  106. package/src/utils/sequence.js +1 -1
  107. package/src/utils/var.js +3 -3
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": "3.6.7",
5
+ "version": "3.7.0",
6
6
  "files": [
7
7
  "dist",
8
8
  "*.js",
@@ -33,8 +33,8 @@
33
33
  "prepublish": "npm run build && npm run copy:package:cjs"
34
34
  },
35
35
  "dependencies": {
36
- "@domql/utils": "^3.6.7",
37
- "@symbo.ls/smbls-utils": "^3.6.7",
36
+ "@domql/utils": "^3.7.0",
37
+ "@symbo.ls/smbls-utils": "^3.7.0",
38
38
  "color-contrast-checker": "^1.5.0"
39
39
  },
40
40
  "gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
@@ -1,3 +1,3 @@
1
1
  'use strict'
2
2
 
3
- export const ANIMATION = {}
3
+ export const animation = {}
@@ -1,3 +1,3 @@
1
1
  'use strict'
2
2
 
3
- export const CASES = {}
3
+ export const cases = {}
@@ -5,5 +5,5 @@ var proto = { // eslint-disable-line
5
5
  value: ''
6
6
  }
7
7
 
8
- export const COLOR = {}
9
- export const GRADIENT = {}
8
+ export const color = {}
9
+ export const gradient = {}
@@ -1,3 +1,3 @@
1
1
  'use strict'
2
2
 
3
- export const DOCUMENT = {}
3
+ export const document = {}
@@ -6,10 +6,10 @@ var defaultFont = { // eslint-disable-line
6
6
  type: ''
7
7
  }
8
8
 
9
- export const FONT_FAMILY = {}
10
- export const FONT_FAMILY_TYPES = {
9
+ export const font_family = {}
10
+ export const font_family_types = {
11
11
  'sans-serif': 'Helvetica, Arial, sans-serif, --system-default',
12
12
  serif: 'Times New Roman, Georgia, serif, --system-default',
13
13
  monospace: 'Courier New, monospace, --system-default'
14
14
  }
15
- export const FONT_FACE = {}
15
+ export const font_face = {}
@@ -9,4 +9,4 @@ var defFont = { // eslint-disable-line
9
9
  fontOpticalSizing: 'auto'
10
10
  }
11
11
 
12
- export const FONT = {}
12
+ export const font = {}
@@ -2,4 +2,4 @@
2
2
 
3
3
  const defaultProps = {}
4
4
 
5
- export const GRID = defaultProps
5
+ export const grid = defaultProps
@@ -1,4 +1,4 @@
1
1
  'use strict'
2
2
 
3
- export const ICONS = {}
4
- export const SEMANTIC_ICONS = {}
3
+ export const icons = {}
4
+ export const semantic_icons = {}
@@ -21,4 +21,4 @@ export * from './templates.js'
21
21
  export * from './grid.js'
22
22
  export * from './class.js'
23
23
 
24
- export const RESET = {}
24
+ export const reset = {}
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- export const MEDIA = {
3
+ export const media = {
4
4
  tv: '(min-width: 2780px)',
5
5
 
6
6
  light: '(prefers-color-scheme: light)',
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- export const BREAKPOINTS = {
3
+ export const breakpoints = {
4
4
  screenL: 1920,
5
5
  screenM: 1680,
6
6
  screenS: 1440,
@@ -13,7 +13,7 @@ export const BREAKPOINTS = {
13
13
  mobileXS: 375
14
14
  }
15
15
 
16
- export const DEVICES = {
16
+ export const devices = {
17
17
  screenXXL: [2560, 1440],
18
18
  screenXL: [2240, 1260],
19
19
  screenL: [1920, 1024],
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- export const SEQUENCE = {
3
+ export const sequence = {
4
4
  'minor-second': 1.067,
5
5
  'major-second': 1.125,
6
6
  'minor-third': 1.2,
@@ -1,8 +1,3 @@
1
1
  'use strict'
2
2
 
3
- const shadow = { // eslint-disable-line
4
- name: 'primaryShadow',
5
- boxShadow: 'gray12, 0 0px 50px 50px'
6
- }
7
-
8
- export const SHADOW = {}
3
+ export const shadow = {}
@@ -1,12 +1,12 @@
1
1
  'use strict'
2
2
 
3
- import { SEQUENCE } from './sequence.js'
4
- import { TYPOGRAPHY } from './typography.js'
3
+ import { sequence } from './sequence.js'
4
+ import { typography } from './typography.js'
5
5
 
6
6
  const defaultProps = {
7
- base: TYPOGRAPHY.base,
7
+ base: typography.base,
8
8
  type: 'spacing',
9
- ratio: SEQUENCE.phi,
9
+ ratio: sequence.phi,
10
10
  range: [-5, +15],
11
11
  subSequence: true,
12
12
  mediaRegenerate: false,
@@ -16,4 +16,4 @@ const defaultProps = {
16
16
  vars: {}
17
17
  }
18
18
 
19
- export const SPACING = defaultProps
19
+ export const spacing = defaultProps
@@ -1,4 +1,4 @@
1
1
  'use strict'
2
2
 
3
- export const SVG = {}
4
- export const SVG_DATA = {}
3
+ export const svg = {}
4
+ export const svg_data = {}
@@ -1,3 +1,3 @@
1
1
  'use strict'
2
2
 
3
- export const TEMPLATES = {}
3
+ export const templates = {}
@@ -10,4 +10,4 @@ const themeA = { // eslint-disable-line no-unused-vars
10
10
  inverse: {} // schemeAInverse
11
11
  }
12
12
 
13
- export const THEME = {}
13
+ export const theme = {}
@@ -1,12 +1,12 @@
1
1
  'use strict'
2
2
 
3
- import { SEQUENCE } from './sequence'
3
+ import { sequence } from './sequence'
4
4
 
5
5
  const defaultProps = {
6
6
  default: 150,
7
7
  base: 150,
8
8
  type: 'timing',
9
- ratio: SEQUENCE['perfect-fourth'],
9
+ ratio: sequence['perfect-fourth'],
10
10
  range: [-3, +12],
11
11
  mediaRegenerate: false,
12
12
  unit: 'ms',
@@ -15,4 +15,4 @@ const defaultProps = {
15
15
  vars: {}
16
16
  }
17
17
 
18
- export const TIMING = defaultProps
18
+ export const timing = defaultProps
@@ -1,12 +1,12 @@
1
1
  'use strict'
2
2
 
3
- import { SEQUENCE } from './sequence.js'
3
+ import { sequence } from './sequence.js'
4
4
 
5
5
  const defaultProps = {
6
6
  browserDefault: 16,
7
7
  base: 16,
8
8
  type: 'font-size',
9
- ratio: SEQUENCE['minor-third'],
9
+ ratio: sequence['minor-third'],
10
10
  range: [-3, +12],
11
11
  h1Matches: +6,
12
12
  lineHeight: 1.5,
@@ -19,4 +19,4 @@ const defaultProps = {
19
19
  vars: {}
20
20
  }
21
21
 
22
- export const TYPOGRAPHY = defaultProps
22
+ export const typography = defaultProps
@@ -1,5 +1,5 @@
1
1
  'use strict'
2
2
 
3
- export const UNIT = {
3
+ export const unit = {
4
4
  default: 'em'
5
5
  }
package/src/factory.js CHANGED
@@ -11,14 +11,22 @@ import * as CONF from './defaultConfig'
11
11
  export const CSS_VARS = {}
12
12
  export const CSS_MEDIA_VARS = {}
13
13
 
14
- // Build CONFIG with lowercase keys as canonical
14
+ // Build CONFIG with lowercase/camelCase keys as canonical + UPPERCASE backward compat aliases
15
15
  const _CONF = CONF
16
16
  const _confLower = {}
17
+ const toCamel = (s) => s.replace(/_([a-z])/g, (_, c) => c.toUpperCase())
18
+ const toUpper = (s) => s.replace(/([A-Z])/g, '_$1').toUpperCase()
17
19
  for (const key in _CONF) {
18
20
  const lower = key.toLowerCase()
19
21
  _confLower[lower] = _CONF[key]
20
- // backward compat: keep UPPERCASE alias pointing to same object
22
+ // camelCase alias (e.g. font_family -> fontFamily, semantic_icons -> semanticIcons)
23
+ const camel = toCamel(lower)
24
+ if (camel !== lower) _confLower[camel] = _CONF[key]
25
+ // keep original key if different from lower
21
26
  if (lower !== key) _confLower[key] = _CONF[key]
27
+ // backward compat: add UPPERCASE alias (e.g. typography -> TYPOGRAPHY, fontFamily -> FONT_FAMILY)
28
+ const upper = toUpper(key)
29
+ if (upper !== key) _confLower[upper] = _CONF[key]
22
30
  }
23
31
 
24
32
  export const CONFIG = {
package/src/set.js CHANGED
@@ -31,9 +31,11 @@ export const VALUE_TRANSFORMERS = {
31
31
  gradient: setGradient,
32
32
  font: setFont,
33
33
  font_family: setFontFamily,
34
+ fontfamily: setFontFamily,
34
35
  theme: setTheme,
35
36
  icons: setSvgIcon,
36
37
  semantic_icons: setSameValue,
38
+ semanticicons: setSameValue,
37
39
  svg: setSVG,
38
40
  svg_data: setSameValue,
39
41
  typography: setSameValue,
@@ -106,6 +108,7 @@ export const set = (recivedConfig, options = SET_OPTIONS) => {
106
108
  globalTheme,
107
109
  useDocumentTheme,
108
110
  useDefaultConfig,
111
+ semanticIcons,
109
112
  SEMANTIC_ICONS,
110
113
  semantic_icons,
111
114
  files,
@@ -127,9 +130,10 @@ export const set = (recivedConfig, options = SET_OPTIONS) => {
127
130
  if (globalTheme !== undefined) CONFIG.globalTheme = globalTheme
128
131
  if (recivedConfig.useThemeSuffixedVars !== undefined) CONFIG.useThemeSuffixedVars = recivedConfig.useThemeSuffixedVars
129
132
  if (useDefaultConfig !== undefined) CONFIG.useDefaultConfig = useDefaultConfig
130
- const _semanticIcons = SEMANTIC_ICONS || semantic_icons
133
+ const _semanticIcons = semanticIcons || SEMANTIC_ICONS || semantic_icons
131
134
  if (_semanticIcons !== undefined) {
132
135
  CONFIG.semantic_icons = _semanticIcons
136
+ CONFIG.semanticIcons = CONFIG.semantic_icons
133
137
  CONFIG.SEMANTIC_ICONS = CONFIG.semantic_icons // backward compat alias
134
138
  }
135
139
  if (CONFIG.verbose) console.log(CONFIG)
@@ -155,17 +159,17 @@ export const set = (recivedConfig, options = SET_OPTIONS) => {
155
159
  })
156
160
 
157
161
  // apply generic configs
158
- if (config.TYPOGRAPHY || config.typography) {
162
+ if (config.typography || config.TYPOGRAPHY) {
159
163
  try { applyTypographySequence() } catch (e) {
160
164
  if (CONFIG.verbose) console.warn('Error applying typography sequence', e)
161
165
  }
162
166
  }
163
- if (config.SPACING || config.spacing) {
167
+ if (config.spacing || config.SPACING) {
164
168
  try { applySpacingSequence() } catch (e) {
165
169
  if (CONFIG.verbose) console.warn('Error applying spacing sequence', e)
166
170
  }
167
171
  }
168
- if (config.TIMING || config.timing) {
172
+ if (config.timing || config.TIMING) {
169
173
  try { applyTimingSequence() } catch (e) {
170
174
  if (CONFIG.verbose) console.warn('Error applying timing sequence', e)
171
175
  }
@@ -34,7 +34,7 @@ export const getColor = (value, key, config) => {
34
34
  tone = parsed.tone
35
35
  }
36
36
 
37
- const { COLOR, GRADIENT } = CONFIG
37
+ const { color: COLOR, gradient: GRADIENT } = CONFIG
38
38
 
39
39
  let val = (COLOR[name] || GRADIENT[name])
40
40
 
@@ -87,7 +87,7 @@ export const getMediaColor = (value, globalTheme, config) => {
87
87
  name = parsed.name
88
88
  }
89
89
 
90
- const { COLOR, GRADIENT } = CONFIG
90
+ const { color: COLOR, gradient: GRADIENT } = CONFIG
91
91
  const val = COLOR[name] || GRADIENT[name]
92
92
  const isObj = isObject(val)
93
93
 
@@ -97,7 +97,7 @@ export const getMediaColor = (value, globalTheme, config) => {
97
97
  else {
98
98
  const obj = {}
99
99
  for (const mediaName in val) {
100
- const query = CONFIG.MEDIA[mediaName.slice(1)]
100
+ const query = CONFIG.media[mediaName.slice(1)]
101
101
  const media = '@media ' + (query === 'print' ? `${query}` : `screen and ${query}`)
102
102
  obj[media] = getColor(value, mediaName, config)
103
103
  }
@@ -122,7 +122,7 @@ export const setColor = (val, key, suffix) => {
122
122
  )) {
123
123
  // Handle space-separated format: '--colorName alpha' (e.g. '--gray1 1')
124
124
  const parts = rawRef.split(' ')
125
- const refColor = CONFIG.COLOR[parts[0]]
125
+ const refColor = CONFIG.color[parts[0]]
126
126
  if (refColor && refColor.value) {
127
127
  let rgb = refColor.rgb
128
128
  const alpha = parts[1] !== undefined ? parts[1] : '1'
@@ -6,7 +6,7 @@ import { getDefaultOrFirstKey } from '../utils'
6
6
 
7
7
  export const applyDocument = () => {
8
8
  const CONFIG = getActiveConfig()
9
- const { DOCUMENT, FONT_FAMILY, THEME, TYPOGRAPHY } = CONFIG
9
+ const { document: DOCUMENT, font_family: FONT_FAMILY, theme: THEME, typography: TYPOGRAPHY } = CONFIG
10
10
  return merge(DOCUMENT, {
11
11
  theme: THEME.document,
12
12
  fontFamily: getDefaultOrFirstKey(FONT_FAMILY),
@@ -42,13 +42,13 @@ export const setFont = (val, key) => {
42
42
 
43
43
  export const getFontFamily = (key, factory) => {
44
44
  const CONFIG = getActiveConfig()
45
- const { FONT_FAMILY } = CONFIG
45
+ const { font_family: FONT_FAMILY } = CONFIG
46
46
  return getDefaultOrFirstKey(factory || FONT_FAMILY, key)
47
47
  }
48
48
 
49
49
  export const setFontFamily = (val, key) => {
50
50
  const CONFIG = getActiveConfig()
51
- const { FONT_FAMILY, FONT_FAMILY_TYPES } = CONFIG
51
+ const { font_family: FONT_FAMILY, font_family_types: FONT_FAMILY_TYPES } = CONFIG
52
52
  let { value, type } = val
53
53
  if (val.isDefault) FONT_FAMILY.default = key
54
54
 
@@ -7,7 +7,7 @@ import { getMediaTheme } from './theme.js'
7
7
  export const applyReset = (reset = {}) => {
8
8
  const CONFIG = getActiveConfig()
9
9
 
10
- const { RESET, TYPOGRAPHY, DOCUMENT } = CONFIG
10
+ const { reset: RESET, typography: TYPOGRAPHY, document: DOCUMENT } = CONFIG
11
11
 
12
12
  if (RESET) {
13
13
  if (RESET[':root']) {
@@ -61,7 +61,7 @@ export const applyReset = (reset = {}) => {
61
61
  fontFamily: DOCUMENT.fontFamily,
62
62
 
63
63
  fontSize:
64
- TYPOGRAPHY.base / TYPOGRAPHY.browserDefault + CONFIG.UNIT.default,
64
+ TYPOGRAPHY.base / TYPOGRAPHY.browserDefault + CONFIG.unit.default,
65
65
 
66
66
  ...templates,
67
67
  ...body
@@ -75,7 +75,7 @@ export const getShadow = (value, globalTheme) => {
75
75
 
76
76
  const [name] = isArray(value) ? value : value.split(' ')
77
77
 
78
- const { SHADOW } = CONFIG
78
+ const SHADOW = CONFIG.shadow
79
79
  const val = SHADOW[name]
80
80
  const isObj = isObject(val)
81
81
 
@@ -94,7 +94,7 @@ export const getShadow = (value, globalTheme) => {
94
94
  if (isObj) {
95
95
  const obj = {}
96
96
  for (const mediaName in val) {
97
- const query = CONFIG.MEDIA[mediaName.slice(1)]
97
+ const query = CONFIG.media[mediaName.slice(1)]
98
98
  const media = '@media ' + (query === 'print' ? `${query}` : `screen and ${query}`)
99
99
  obj[media] = val.value
100
100
  }
@@ -50,7 +50,7 @@ export const checkIfBoxSize = (propertyName) => {
50
50
 
51
51
  export const applySpacingSequence = () => {
52
52
  const CONFIG = getActiveConfig()
53
- const { SPACING } = CONFIG
53
+ const { spacing: SPACING } = CONFIG
54
54
  generateSequence(SPACING)
55
55
  applySequenceVars(SPACING)
56
56
  runThroughMedia(SPACING)
@@ -58,7 +58,7 @@ export const applySpacingSequence = () => {
58
58
 
59
59
  const getSequence = (sequenceProps) => {
60
60
  const CONFIG = getActiveConfig()
61
- const { SPACING } = CONFIG
61
+ const { spacing: SPACING } = CONFIG
62
62
  if (!sequenceProps || !sequenceProps.sequence) return SPACING
63
63
  const hasGenerated = Object.keys(sequenceProps.sequence).length > 0
64
64
  return hasGenerated ? sequenceProps : generateSequence(sequenceProps)
@@ -114,7 +114,7 @@ export const getSpacingByKey = (
114
114
 
115
115
  export const getSpacingBasedOnRatio = (props, propertyName, val, fnPrefix) => {
116
116
  const CONFIG = getActiveConfig()
117
- const { SPACING } = CONFIG
117
+ const { spacing: SPACING } = CONFIG
118
118
 
119
119
  let value = val || props[propertyName]
120
120
 
package/src/system/svg.js CHANGED
@@ -22,15 +22,15 @@ export const setSVG = (val, key) => {
22
22
  export const appendSVGSprite = (LIBRARY, options = DEF_OPTIONS) => {
23
23
  const CONFIG = getActiveConfig()
24
24
 
25
- const lib = Object.keys(LIBRARY).length ? {} : CONFIG.SVG
26
- for (const key in LIBRARY) lib[key] = CONFIG.SVG[key]
25
+ const lib = Object.keys(LIBRARY).length ? {} : CONFIG.svg
26
+ for (const key in LIBRARY) lib[key] = CONFIG.svg[key]
27
27
 
28
28
  appendSVG(lib, options)
29
29
  }
30
30
 
31
31
  export const setSvgIcon = (val, key) => {
32
32
  const CONFIG = getActiveConfig()
33
- if (CONFIG.useIconSprite && !CONFIG.SEMANTIC_ICONS?.[key]) {
33
+ if (CONFIG.useIconSprite && !CONFIG.semantic_icons?.[key]) {
34
34
  return setSVG(val, key)
35
35
  } return val
36
36
  }
@@ -38,8 +38,8 @@ export const setSvgIcon = (val, key) => {
38
38
  export const appendSvgIconsSprite = (LIBRARY, options = DEF_OPTIONS) => {
39
39
  const CONFIG = getActiveConfig()
40
40
 
41
- const lib = Object.keys(LIBRARY).length ? {} : CONFIG.ICONS
42
- for (const key in LIBRARY) lib[key] = CONFIG.ICONS[key]
41
+ const lib = Object.keys(LIBRARY).length ? {} : CONFIG.icons
42
+ for (const key in LIBRARY) lib[key] = CONFIG.icons[key]
43
43
 
44
44
  appendSVG(lib, options)
45
45
  }
@@ -32,7 +32,7 @@ const getThemeValue = theme => {
32
32
  export const getTheme = (value, modifier) => {
33
33
  const CONFIG = getActiveConfig()
34
34
  if (CONFIG.useVariable) return getMediaTheme(value, modifier)
35
- const { THEME } = CONFIG
35
+ const THEME = CONFIG.theme
36
36
 
37
37
  if (isString(value)) {
38
38
  const [theme, subtheme] = value.split(' ')
@@ -112,13 +112,15 @@ const setHelpers = (theme, value) => {
112
112
  const keys = Object.keys(helpers)
113
113
  keys.map(key => {
114
114
  const helper = helpers[key]
115
- if (isString(helper)) helpers[key] = CONFIG.THEME[helper]
115
+ if (isString(helper)) helpers[key] = CONFIG.theme[helper]
116
116
  else getThemeValue(helpers[key])
117
117
  return theme
118
118
  })
119
119
  return theme
120
120
  }
121
121
 
122
+
123
+
122
124
  export const setTheme = (val, key) => {
123
125
  const CONFIG = getActiveConfig()
124
126
  if (CONFIG.useVariable) return setMediaTheme(val, key)
@@ -288,7 +290,7 @@ export const setMediaTheme = (val, key, suffix, prefers) => {
288
290
  }
289
291
 
290
292
  if (isString(val) && isCSSVar(val)) {
291
- const { THEME } = CONFIG
293
+ const THEME = CONFIG.theme
292
294
  const value = THEME[val.slice(2)]
293
295
  const getReferenced = getMediaTheme(value, prefers)
294
296
  return getReferenced
@@ -348,7 +350,7 @@ export const getMediaTheme = (value, modifier) => {
348
350
  }
349
351
 
350
352
  const [themeName, ...themeModifiers] = isArray(value) ? value : value.split(' ')
351
- let themeValue = activeConfig.THEME[themeName]
353
+ let themeValue = activeConfig.theme[themeName]
352
354
 
353
355
  if (themeValue && themeModifiers.length) {
354
356
  themeValue = findModifier(themeValue, themeModifiers)
@@ -10,20 +10,20 @@ import {
10
10
 
11
11
  export const applyTimingSequence = () => {
12
12
  const CONFIG = getActiveConfig()
13
- const { TIMING } = CONFIG
13
+ const { timing: TIMING } = CONFIG
14
14
  generateSequence(TIMING)
15
15
  applySequenceVars(TIMING)
16
16
  }
17
17
 
18
18
  export const getTimingFunction = value => {
19
19
  const CONFIG = getActiveConfig()
20
- const { TIMING } = CONFIG
20
+ const { timing: TIMING } = CONFIG
21
21
  return TIMING[value] || TIMING[toCamelCase(value)] || value
22
22
  }
23
23
 
24
24
  export const getTimingByKey = (value, property = 'timing') => {
25
25
  const CONFIG = getActiveConfig()
26
- const { TIMING } = CONFIG
26
+ const { timing: TIMING } = CONFIG
27
27
  return getSequenceValuePropertyPair(
28
28
  value,
29
29
  property,
@@ -13,7 +13,7 @@ import {
13
13
 
14
14
  export const runThroughMedia = FACTORY => {
15
15
  const CONFIG = getActiveConfig()
16
- const { TYPOGRAPHY, MEDIA } = CONFIG
16
+ const { typography: TYPOGRAPHY, media: MEDIA } = CONFIG
17
17
 
18
18
  for (const prop in FACTORY) {
19
19
  const isPropMedia = prop.slice(0, 1) === '@'
@@ -86,7 +86,7 @@ export const applyHeadings = props => {
86
86
 
87
87
  export const applyTypographySequence = () => {
88
88
  const CONFIG = getActiveConfig()
89
- const { TYPOGRAPHY } = CONFIG
89
+ const { typography: TYPOGRAPHY } = CONFIG
90
90
 
91
91
  generateSequence(TYPOGRAPHY)
92
92
  applyHeadings(TYPOGRAPHY)
@@ -96,6 +96,6 @@ export const applyTypographySequence = () => {
96
96
 
97
97
  export const getFontSizeByKey = value => {
98
98
  const CONFIG = getActiveConfig()
99
- const { TYPOGRAPHY } = CONFIG
99
+ const { typography: TYPOGRAPHY } = CONFIG
100
100
  return getSequenceValuePropertyPair(value, 'fontSize', TYPOGRAPHY)
101
101
  }
@@ -177,7 +177,7 @@ export const transformBackgroundImage = (backgroundImage, globalTheme) => {
177
177
  if (isCSSVar(v)) return `var(${v})`
178
178
  if (v.includes('url')) return v
179
179
  if (v.includes('gradient')) return resolveColorsInGradient(v, globalTheme)
180
- else if (CONFIG.GRADIENT[backgroundImage]) {
180
+ else if (CONFIG.gradient[backgroundImage]) {
181
181
  return {
182
182
  backgroundImage: getMediaColor(
183
183
  backgroundImage,
@@ -230,7 +230,7 @@ export const generateSequencePosition = (sequenceProps, position = 0) => {
230
230
 
231
231
  export const getSequenceValue = (value = 'A', sequenceProps) => {
232
232
  const CONFIG = getActiveConfig()
233
- const { UNIT } = CONFIG
233
+ const { unit: UNIT } = CONFIG
234
234
 
235
235
  if (isString(value) && isCSSVar(value)) return `var(${value})`
236
236
 
package/src/utils/var.js CHANGED
@@ -17,7 +17,7 @@ export const setVariables = (result, key) => {
17
17
 
18
18
  export const applySequenceGlobalVars = (vars, obj, options) => {
19
19
  const CONFIG = getActiveConfig()
20
- const { UNIT } = CONFIG
20
+ const { unit: UNIT } = CONFIG
21
21
  const unit = obj.unit || UNIT.default
22
22
  const { base, ratio, type } = obj
23
23
  const prefix = '--' + (type && type.replace('.', '-'))
@@ -38,7 +38,7 @@ export const applySequenceGlobalVars = (vars, obj, options) => {
38
38
 
39
39
  export const applySequenceVars = (FACTORY, options = {}) => {
40
40
  const CONFIG = getActiveConfig()
41
- const { UNIT, TIMING, CSS_VARS } = CONFIG
41
+ const { unit: UNIT, timing: TIMING, CSS_VARS } = CONFIG
42
42
 
43
43
  const unit = FACTORY.unit || UNIT.default
44
44
  const { mediaRegenerate, sequence, scales } = FACTORY
@@ -72,7 +72,7 @@ export const applySequenceVars = (FACTORY, options = {}) => {
72
72
 
73
73
  export const applyMediaSequenceVars = (FACTORY, media, options = {}) => {
74
74
  const CONFIG = getActiveConfig()
75
- const { UNIT, MEDIA, CSS_VARS } = CONFIG
75
+ const { unit: UNIT, media: MEDIA, CSS_VARS } = CONFIG
76
76
 
77
77
  const mediaName = media.slice(1)
78
78