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 +1 -1
- package/src/atoms/Media.js +1 -1
- package/src/atoms/Picture.js +13 -4
- package/src/atoms/Theme.js +1 -1
package/package.json
CHANGED
package/src/atoms/Media.js
CHANGED
|
@@ -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:
|
|
146
|
+
themeModifier: globalTheme
|
|
147
147
|
}, { preventRecursive: true, ignoreInitUpdate: true })
|
|
148
148
|
} else if (key === 'true') applyTrueProps(props[key], CLASS_NAMES, element)
|
|
149
149
|
|
package/src/atoms/Picture.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { getSystemTheme } from './Theme'
|
|
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
|
-
|
|
15
|
-
|
|
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 }) => ({
|
|
26
|
+
Img: ({ props }) => ({
|
|
27
|
+
width: 'inherit',
|
|
28
|
+
height: 'inherit',
|
|
29
|
+
src: props.src
|
|
30
|
+
})
|
|
22
31
|
}
|
package/src/atoms/Theme.js
CHANGED
|
@@ -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) => {
|