@symbo.ls/scratch 0.7.3 → 0.7.5
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/defaultConfig/theme.js +0 -7
- package/src/system/color.js +1 -3
- package/src/system/theme.js +1 -1
- package/src/utils/theme.js +8 -0
package/package.json
CHANGED
|
@@ -11,10 +11,3 @@ const themeA = { // eslint-disable-line no-unused-vars
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const THEME = {}
|
|
14
|
-
|
|
15
|
-
export const returnSubThemeOrDefault = (orig, theme) => {
|
|
16
|
-
if (!orig) return
|
|
17
|
-
if (orig.themes && orig.themes[theme]) return orig.themes[theme]
|
|
18
|
-
if (orig[theme]) return [orig, orig[theme]]
|
|
19
|
-
return orig
|
|
20
|
-
}
|
package/src/system/color.js
CHANGED
|
@@ -83,13 +83,11 @@ export const getMediaColor = (value, param) => {
|
|
|
83
83
|
if (isObj && val.value) return { [param]: getColor(value) }
|
|
84
84
|
else if (isObj) {
|
|
85
85
|
const obj = {}
|
|
86
|
-
|
|
87
86
|
for (const mediaName in val) {
|
|
88
87
|
const query = MEDIA[mediaName.slice(1)]
|
|
89
88
|
const media = `@media screen and ${query}`
|
|
90
89
|
obj[media] = { [param]: getColor(value, mediaName) }
|
|
91
90
|
}
|
|
92
|
-
|
|
93
91
|
return obj
|
|
94
92
|
} else {
|
|
95
93
|
if ((ENV === 'test' || ENV === 'development') && CONFIG.verbose) console.warn('Can\'t find color', value)
|
|
@@ -103,7 +101,7 @@ export const setColor = (val, key, suffix) => {
|
|
|
103
101
|
if (isArray(val)) {
|
|
104
102
|
return {
|
|
105
103
|
'@light': setColor(val[0], key, 'light'),
|
|
106
|
-
'@dark': setColor(val[
|
|
104
|
+
'@dark': setColor(val[1], key, 'dark')
|
|
107
105
|
}
|
|
108
106
|
}
|
|
109
107
|
|
package/src/system/theme.js
CHANGED
|
@@ -210,7 +210,7 @@ const findModifier = (val, modifier) => {
|
|
|
210
210
|
// console.log(val)
|
|
211
211
|
// console.log(modifier)
|
|
212
212
|
if (isArray(modifier)) return findModifierFromArray(val, modifier)
|
|
213
|
-
else if (isString(modifier)) return val[modifier]
|
|
213
|
+
else if (isString(modifier) && val[modifier]) return val[modifier]
|
|
214
214
|
else return val
|
|
215
215
|
}
|
|
216
216
|
|