@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 +1 -1
- package/src/config/cases.js +3 -0
- package/src/config/icons.js +3 -0
- package/src/config/index.js +5 -1
- package/src/config/media.js +15 -0
- package/src/config/responsive.js +1 -1
- package/src/config/spacing.js +15 -9
- package/src/methods/set.js +8 -3
package/package.json
CHANGED
package/src/config/index.js
CHANGED
package/src/config/media.js
CHANGED
|
@@ -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
|
+
}
|
package/src/config/responsive.js
CHANGED
package/src/config/spacing.js
CHANGED
|
@@ -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
|
|
package/src/methods/set.js
CHANGED
|
@@ -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
|
-
|
|
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
|
|