@symbo.ls/scratch 0.3.14 → 0.3.17

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": "Symbols",
5
- "version": "0.3.14",
5
+ "version": "0.3.17",
6
6
  "files": [
7
7
  "src"
8
8
  ],
@@ -0,0 +1,3 @@
1
+ 'use strict'
2
+
3
+ export const CASES = {}
@@ -0,0 +1,3 @@
1
+ 'use strict'
2
+
3
+ export const ICONS = {}
@@ -12,6 +12,10 @@ export * from './spacing'
12
12
  export * from './color'
13
13
  export * from './theme'
14
14
 
15
- export * from './responsive'
15
+ export * from './icons'
16
+
17
+ export * from './media'
16
18
 
17
19
  export * from './document'
20
+
21
+ export * from './cases'
@@ -0,0 +1,15 @@
1
+ 'use strict'
2
+
3
+ export const MEDIA = {
4
+ screenL: '(max-width: 1920px)',
5
+ screenD: '(max-width: 1680px)',
6
+ screenS: '(max-width: 1440px)',
7
+ tabletL: '(max-width: 1366px)',
8
+ tabletM: '(max-width: 1280px)',
9
+ tabletS: '(max-width: 1024px)',
10
+ mobileL: '(max-width: 768px)',
11
+ mobileM: '(max-width: 560px)',
12
+ mobileS: '(max-width: 480px)',
13
+
14
+ light: '(prefers-color-scheme: light)'
15
+ }
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- export const RESPONSIVE = {
3
+ export const BREAKPOINTS = {
4
4
  screenL: 1920,
5
5
  screenD: 1680,
6
6
  screenS: 1440,
@@ -42,24 +42,30 @@ export const mapSpacing = (val, property = 'padding', props, unit) => {
42
42
  unit
43
43
  })
44
44
 
45
+ let suffix = ''
46
+ if (property === 'borderWidth') {
47
+ property = 'border'
48
+ suffix = 'Width'
49
+ }
50
+
45
51
  if (length === 2) {
46
52
  return [
47
- wrapFallBack(property + 'Block', 0),
48
- wrapFallBack(property + 'Inline', 1)
53
+ wrapFallBack(property + 'Block' + suffix, 0),
54
+ wrapFallBack(property + 'Inline' + suffix, 1)
49
55
  ]
50
56
  }
51
57
  if (length === 3) {
52
58
  return [
53
- wrapFallBack(property + 'BlockStart', 0),
54
- wrapFallBack(property + 'Inline', 1),
55
- wrapFallBack(property + 'BlockEnd', 2)
59
+ wrapFallBack(property + 'BlockStart' + suffix, 0),
60
+ wrapFallBack(property + 'Inline' + suffix, 1),
61
+ wrapFallBack(property + 'BlockEnd' + suffix, 2)
56
62
  ]
57
63
  } else if (length === 4) {
58
64
  return [
59
- wrapFallBack(property + 'BlockStart', 0),
60
- wrapFallBack(property + 'InlineStart', 3),
61
- wrapFallBack(property + 'BlockEnd', 2),
62
- wrapFallBack(property + 'InlineEnd', 1)
65
+ wrapFallBack(property + 'BlockStart' + suffix, 0),
66
+ wrapFallBack(property + 'InlineStart' + suffix, 3),
67
+ wrapFallBack(property + 'BlockEnd' + suffix, 2),
68
+ wrapFallBack(property + 'InlineEnd' + suffix, 1)
63
69
  ]
64
70
  }
65
71
 
@@ -104,7 +104,6 @@ const getThemeValue = theme => {
104
104
 
105
105
  export const getTheme = value => {
106
106
  const { THEME } = CONFIG
107
- // console.log('theme', THEME, CONFIG)
108
107
  if (isObjectLike(value) && value[1]) {
109
108
  const themeName = value[0]
110
109
  const subThemeName = value[1]
@@ -214,6 +213,10 @@ const setFontFamily = (val, key) => {
214
213
  return { var: CSSvar, value: str, arr: value, type }
215
214
  }
216
215
 
216
+ const setCases = (val, key) => {
217
+ return val()
218
+ }
219
+
217
220
  const setSameValue = (val, key) => val
218
221
 
219
222
  export const SETTERS = {
@@ -224,7 +227,9 @@ export const SETTERS = {
224
227
  theme: setTheme,
225
228
  typography: setSameValue,
226
229
  spacing: setSameValue,
227
- responsive: setSameValue
230
+ media: setSameValue,
231
+ cases: setCases,
232
+ icons: setSameValue
228
233
  }
229
234
 
230
235
  /**
@@ -262,8 +267,8 @@ export const set = recivedConfig => {
262
267
  applyDocument()
263
268
 
264
269
  CONFIG.verbose = verbose
270
+ if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose) console.log(CONFIG)
265
271
 
266
- console.log(CONFIG)
267
272
  return CONFIG
268
273
  }
269
274