smbls 0.15.42 → 0.15.44
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/Button.js +1 -2
- package/src/atoms/Text.js +1 -1
- package/src/atoms/Theme.js +10 -2
- package/src/atoms/Timing.js +1 -0
package/package.json
CHANGED
package/src/Button.js
CHANGED
package/src/atoms/Text.js
CHANGED
|
@@ -31,7 +31,7 @@ export const P = { tag: 'p' }
|
|
|
31
31
|
export const Caption = { tag: 'caption' }
|
|
32
32
|
export const Strong = {
|
|
33
33
|
tag: 'strong',
|
|
34
|
-
props: { fontWeight: '
|
|
34
|
+
props: { fontWeight: '700' }
|
|
35
35
|
}
|
|
36
36
|
export const Underline = { tag: 'u' }
|
|
37
37
|
export const Italic = { tag: 'i' }
|
package/src/atoms/Theme.js
CHANGED
|
@@ -11,7 +11,8 @@ const transformBorder = border => {
|
|
|
11
11
|
const arr = border.split(', ')
|
|
12
12
|
return arr.map(v => {
|
|
13
13
|
v = v.trim()
|
|
14
|
-
if (
|
|
14
|
+
if (v.slice(0, 2) === '--') return `var(${v})`
|
|
15
|
+
else if (isBorderStyle(v)) return v || 'solid'
|
|
15
16
|
else if (v.slice(-2) === 'px' || v.slice(-2) === 'em') return v // TODO: add map spacing
|
|
16
17
|
else if (getColor(v).length > 2) return getColor(v)
|
|
17
18
|
return getSpacingByKey(v, 'border').border
|
|
@@ -20,14 +21,16 @@ const transformBorder = border => {
|
|
|
20
21
|
|
|
21
22
|
const transformTextStroke = stroke => ({
|
|
22
23
|
WebkitTextStroke: stroke.split(', ').map(v => {
|
|
24
|
+
if (v.slice(0, 2) === '--') return `var(${v})`
|
|
23
25
|
if (v.includes('px')) return v
|
|
24
26
|
else if (getColor(v)) return getColor(v)
|
|
25
27
|
}).join(' ')
|
|
26
28
|
})
|
|
27
29
|
|
|
28
|
-
const transformShadow = shadows => shadows.split('|').map(shadow => {
|
|
30
|
+
export const transformShadow = shadows => shadows.split('|').map(shadow => {
|
|
29
31
|
return shadow.split(', ').map(v => {
|
|
30
32
|
v = v.trim()
|
|
33
|
+
if (v.slice(0, 2) === '--') return `var(${v})`
|
|
31
34
|
if (getColor(v).length > 2) return getColor(v)
|
|
32
35
|
if (v.includes('px') || v.slice(-2) === 'em') return v
|
|
33
36
|
const arr = v.split(' ')
|
|
@@ -38,6 +41,7 @@ const transformShadow = shadows => shadows.split('|').map(shadow => {
|
|
|
38
41
|
|
|
39
42
|
const transformBackgroundImage = (backgroundImage, ctx, globalTheme) => ({
|
|
40
43
|
backgroundImage: backgroundImage.split(', ').map(v => {
|
|
44
|
+
if (v.slice(0, 2) === '--') return `var(${v})`
|
|
41
45
|
if (v.includes('url') || v.includes('gradient')) return v
|
|
42
46
|
else if (ctx.SYSTEM.GRADIENT[backgroundImage]) {
|
|
43
47
|
return getMediaColor(backgroundImage, 'backgroundImage', globalTheme)
|
|
@@ -122,6 +126,10 @@ export const Theme = {
|
|
|
122
126
|
boxShadow: transformShadow(props.boxShadow)
|
|
123
127
|
}),
|
|
124
128
|
|
|
129
|
+
textShadow: ({ props }) => props.textShadow && ({
|
|
130
|
+
textShadow: transformShadow(props.textShadow)
|
|
131
|
+
}),
|
|
132
|
+
|
|
125
133
|
opacity: ({ props }) => props.opacity && ({ opacity: props.opacity }),
|
|
126
134
|
visibility: ({ props }) => props.visibility && ({ visibility: props.visibility })
|
|
127
135
|
}
|
package/src/atoms/Timing.js
CHANGED
|
@@ -9,6 +9,7 @@ export const transformTransition = transition => {
|
|
|
9
9
|
if (!arr.length) return transition
|
|
10
10
|
|
|
11
11
|
return arr.map(v => {
|
|
12
|
+
if (v.slice(0, 2) === '--') return `var(${v})`
|
|
12
13
|
if (v.length < 3 || v.includes('ms')) {
|
|
13
14
|
const mapWithSequence = getTimingByKey(v)
|
|
14
15
|
return mapWithSequence.timing || v
|