smbls 0.8.36 → 0.8.39
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/Link.js +0 -2
- package/src/Media.js +6 -18
package/package.json
CHANGED
package/src/Link.js
CHANGED
package/src/Media.js
CHANGED
|
@@ -70,19 +70,20 @@ const applySelectorProps = (key, props, result, element) => {
|
|
|
70
70
|
|
|
71
71
|
const applyCaseProps = (key, props, result, element) => {
|
|
72
72
|
const caseKey = key.slice(1)
|
|
73
|
-
|
|
73
|
+
const isPropTrue = element.props[caseKey]
|
|
74
|
+
if (!CONFIG_CASES[caseKey] && !isPropTrue) return
|
|
74
75
|
return merge(result, convertPropsToClass(props, result, element))
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
const applyConditionalCaseProps = (key, props, result, element) => {
|
|
78
79
|
const caseKey = key.slice(1)
|
|
79
80
|
const isPropTrue = element.props[caseKey]
|
|
80
|
-
console.log(isPropTrue)
|
|
81
|
-
console.log(result)
|
|
82
81
|
if (!isPropTrue) return // remove classname if not here
|
|
83
82
|
return merge(result, convertPropsToClass(props, result, element))
|
|
84
83
|
}
|
|
85
84
|
|
|
85
|
+
const applyTrueProps = (props, result, element) => merge(result, convertPropsToClass(props, result, element))
|
|
86
|
+
|
|
86
87
|
const beforeClassAssign = (element, s) => {
|
|
87
88
|
const { props, class: className } = element
|
|
88
89
|
|
|
@@ -117,27 +118,14 @@ export const initUpdate = element => {
|
|
|
117
118
|
const setter = keySetters[key.slice(0, 1)]
|
|
118
119
|
if (key === 'theme') {
|
|
119
120
|
props.update({ themeModifier: globalTheme }, { preventRecursive: true, ignoreInitUpdate: true })
|
|
120
|
-
}
|
|
121
|
+
} else if (key === 'true') applyTrueProps(props[key], CLASS_NAMES, element)
|
|
122
|
+
|
|
121
123
|
if (setter) setter(key, props[key], CLASS_NAMES, element)
|
|
122
124
|
}
|
|
123
125
|
|
|
124
126
|
if (Object.keys(CLASS_NAMES.media).length) className.media = CLASS_NAMES.media
|
|
125
127
|
className.selector = CLASS_NAMES.selector
|
|
126
128
|
className.case = CLASS_NAMES.case
|
|
127
|
-
|
|
128
|
-
// for (const screen in props) {
|
|
129
|
-
// if (screen.slice(0, 1) === '@') {
|
|
130
|
-
// const mediaName = screen.slice(1)
|
|
131
|
-
// const mediaKey = `@media screen and ${CONFIG_MEDIA[mediaName]}`
|
|
132
|
-
// if (mediaName === 'dark' || mediaName === 'light') {
|
|
133
|
-
// const { MEDIA_FORCE } = className
|
|
134
|
-
// if (!MEDIA_FORCE) className.media = {}
|
|
135
|
-
// if (globalTheme === mediaName) {
|
|
136
|
-
// className.MEDIA_FORCED = className.MEDIA[mediaKey]
|
|
137
|
-
// } else className.MEDIA_FORCED = {}
|
|
138
|
-
// }
|
|
139
|
-
// }
|
|
140
|
-
// }
|
|
141
129
|
}
|
|
142
130
|
|
|
143
131
|
export const Responsive = {
|