smbls 0.15.10 → 0.15.11
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 -1
- package/src/Input.js +1 -1
- package/src/atoms/Block.js +1 -1
- package/src/atoms/Theme.js +10 -7
package/package.json
CHANGED
package/src/Button.js
CHANGED
package/src/Input.js
CHANGED
package/src/atoms/Block.js
CHANGED
|
@@ -4,7 +4,7 @@ import { getSpacingBasedOnRatio, getSpacingByKey } from '@symbo.ls/scratch'
|
|
|
4
4
|
|
|
5
5
|
export const Block = {
|
|
6
6
|
class: {
|
|
7
|
-
boxSizing: ({ props }) => props.boxSizing ? ({
|
|
7
|
+
boxSizing: ({ props }) => props.boxSizing ? ({ boxSizing: props.boxSizing }) : {
|
|
8
8
|
boxSizing: 'border-box'
|
|
9
9
|
},
|
|
10
10
|
|
package/src/atoms/Theme.js
CHANGED
|
@@ -10,6 +10,7 @@ const isBorderStyle = str =>
|
|
|
10
10
|
const transformBorder = border => {
|
|
11
11
|
const arr = border.split(', ')
|
|
12
12
|
return arr.map(v => {
|
|
13
|
+
v = v.trim()
|
|
13
14
|
if (isBorderStyle(v)) return v || 'solid'
|
|
14
15
|
else if (v.slice(-2) === 'px' || v.slice(-2) === 'em') return v // TODO: add map spacing
|
|
15
16
|
else if (getColor(v).length > 2) return getColor(v)
|
|
@@ -24,16 +25,16 @@ const transformTextStroke = stroke => ({
|
|
|
24
25
|
}).join(' ')
|
|
25
26
|
})
|
|
26
27
|
|
|
27
|
-
const transformShadow = shadow =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (v.
|
|
31
|
-
|
|
28
|
+
const transformShadow = shadows => shadows.split('|').map(shadow => {
|
|
29
|
+
return shadow.split(', ').map(v => {
|
|
30
|
+
v = v.trim()
|
|
31
|
+
if (getColor(v).length > 2) return getColor(v)
|
|
32
|
+
if (v.includes('px') || v.slice(-2) === 'em') return v
|
|
32
33
|
const arr = v.split(' ')
|
|
33
34
|
if (!arr.length) return v
|
|
34
35
|
return arr.map(v => getSpacingByKey(v, 'shadow').shadow).join(' ')
|
|
35
36
|
}).join(' ')
|
|
36
|
-
})
|
|
37
|
+
}).join(',')
|
|
37
38
|
|
|
38
39
|
const transformBackgroundImage = (backgroundImage, ctx) => ({
|
|
39
40
|
backgroundImage: backgroundImage.split(', ').map(v => {
|
|
@@ -86,7 +87,9 @@ export const Theme = {
|
|
|
86
87
|
borderBottom: transformBorder(props.borderBottom)
|
|
87
88
|
}),
|
|
88
89
|
|
|
89
|
-
boxShadow: ({ props }) => props.boxShadow
|
|
90
|
+
boxShadow: ({ props }) => props.boxShadow && ({
|
|
91
|
+
boxShadow: transformShadow(props.boxShadow)
|
|
92
|
+
}),
|
|
90
93
|
|
|
91
94
|
opacity: ({ props }) => props.opacity && ({ opacity: props.opacity }),
|
|
92
95
|
visibility: ({ props }) => props.visibility && ({ visibility: props.visibility })
|