smbls 0.15.38 → 0.15.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.
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.15.38",
6
+ "version": "0.15.40",
7
7
  "repository": "https://github.com/symbo-ls/smbls",
8
8
  "main": "src/index.js",
9
9
  "files": [
@@ -143,7 +143,7 @@ export const initUpdate = element => {
143
143
  const setter = keySetters[key.slice(0, 1)]
144
144
  if (key === 'theme') {
145
145
  props.update({
146
- themeModifier: `@${globalTheme}`
146
+ themeModifier: globalTheme
147
147
  }, { preventRecursive: true, ignoreInitUpdate: true })
148
148
  } else if (key === 'true') applyTrueProps(props[key], CLASS_NAMES, element)
149
149
 
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { getSystemTheme } from './Theme' // eslint-disable-line no-unused-vars
3
+ import { getSystemTheme } from './Theme'
4
4
 
5
5
  export const Picture = {
6
6
  tag: 'picture',
@@ -11,12 +11,21 @@ export const Picture = {
11
11
  media: element => {
12
12
  const { props, key, context } = element
13
13
  const { MEDIA } = context.SYSTEM
14
- // getSystemTheme(element)
15
- return MEDIA[(props.media || key).slice(1)]
14
+ const globalTheme = getSystemTheme(element)
15
+ const mediaName = (props.media || key).slice(1)
16
+
17
+ if (mediaName === globalTheme) return '(min-width: 0px)'
18
+ else if (mediaName === 'dark' || mediaName === 'light') return '(max-width: 0px)'
19
+
20
+ return MEDIA[mediaName]
16
21
  },
17
22
  srcset: ({ props }) => props.srcset
18
23
  }
19
24
  },
20
25
 
21
- Img: ({ props }) => ({ src: props.src })
26
+ Img: ({ props }) => ({
27
+ width: 'inherit',
28
+ height: 'inherit',
29
+ src: props.src
30
+ })
22
31
  }
@@ -60,7 +60,7 @@ export const Theme = {
60
60
  const { props } = element
61
61
  const globalTheme = getSystemTheme(element)
62
62
  if (!props.theme) return
63
- return getMediaTheme(props.theme, props.themeModifier || globalTheme)
63
+ return getMediaTheme(props.theme, `@${props.themeModifier || globalTheme}`)
64
64
  },
65
65
 
66
66
  color: (element) => {