smbls 0.8.39 → 0.8.40

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Media.js +4 -2
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "UI Library built on Scratch and DOMQL",
4
4
  "private": false,
5
5
  "author": "symbo.ls",
6
- "version": "0.8.39",
6
+ "version": "0.8.40",
7
7
  "repository": "https://github.com/symbo-ls/smbls",
8
8
  "main": "src/index.js",
9
9
  "files": [
package/src/Media.js CHANGED
@@ -47,13 +47,15 @@ const convertPropsToClass = (props, result, element) => {
47
47
  const applyMediaProps = (key, props, result, element) => {
48
48
  const mediaName = CONFIG_MEDIA[key.slice(1)]
49
49
  const generatedClass = convertPropsToClass(props, result, element)
50
+
50
51
  const rootState = element.__root ? element.__root.state : element.state
51
52
  const { globalTheme } = rootState
52
53
  const name = key.slice(1)
54
+ const isTheme = ['dark', 'light'].includes(name)
53
55
  const matchesGlobal = name === globalTheme
54
56
 
55
- if (globalTheme) {
56
- if (matchesGlobal) merge(result, generatedClass)
57
+ if (globalTheme && isTheme) {
58
+ if (matchesGlobal) return merge(result, generatedClass)
57
59
  return
58
60
  }
59
61