@symbo.ls/scratch 0.3.13 → 0.3.16

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.13",
5
+ "version": "0.3.16",
6
6
  "files": [
7
7
  "src"
8
8
  ],
@@ -0,0 +1,3 @@
1
+ 'use strict'
2
+
3
+ export const ICONS = {}
@@ -12,6 +12,8 @@ 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'
@@ -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
 
@@ -224,7 +224,8 @@ export const SETTERS = {
224
224
  theme: setTheme,
225
225
  typography: setSameValue,
226
226
  spacing: setSameValue,
227
- responsive: setSameValue
227
+ media: setSameValue,
228
+ icons: setSameValue
228
229
  }
229
230
 
230
231
  /**
@@ -262,8 +263,8 @@ export const set = recivedConfig => {
262
263
  applyDocument()
263
264
 
264
265
  CONFIG.verbose = verbose
266
+ if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose) console.log(CONFIG)
265
267
 
266
- console.log(CONFIG)
267
268
  return CONFIG
268
269
  }
269
270
 
@@ -160,7 +160,7 @@ export const changeLightness = (delta, hsl) => {
160
160
 
161
161
  export const rgbToHSL = (r, g, b) => {
162
162
  const a = Math.max(r, g, b); const n = a - Math.min(r, g, b); const f = (1 - Math.abs(a + a - n - 1))
163
- const h = n && ((a == r) ? (g - b) / n : ((a == g) ? 2 + (b - r) / n : 4 + (r - g) / n))
163
+ const h = n && ((a == r) ? (g - b) / n : ((a == g) ? 2 + (b - r) / n : 4 + (r - g) / n)) //eslint-disable-line
164
164
  return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2]
165
165
  }
166
166
 
@@ -328,7 +328,7 @@ export const fallBack = ({ type, prop, val = 'A', prefix = '--font-size-', unit
328
328
  if (typeof val !== 'string') console.warn(prop, val, 'is not a string')
329
329
 
330
330
  if (val === '-' || val === '') return ({ })
331
- if (val === 'auto' || val === 'fit-content' || val === 'min-content' || val === 'max-content') return ({ [prop]: val })
331
+ if (val === 'none' || val === 'auto' || val === 'fit-content' || val === 'min-content' || val === 'max-content') return ({ [prop]: val })
332
332
 
333
333
  // const startsWithLetterRegex = /^[a-zA-Z]/i
334
334
  const startsWithLetterRegex = /^-?[a-zA-Z]/i