css-in-props 0.9.3 → 0.9.4
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/index.js +1 -1
- package/src/registry.js +1 -1
- package/src/set.js +8 -0
- package/src/transform/classname.js +2 -1
- package/src/transform/emotion.js +3 -13
- package/src/transform/index.js +1 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
package/src/registry.js
CHANGED
|
@@ -64,7 +64,7 @@ export const theme = {
|
|
|
64
64
|
theme: props => props.theme ? getTheme(props.theme) : null,
|
|
65
65
|
|
|
66
66
|
color: props => props.color ? ({ color: getColor(props.color) }) : null,
|
|
67
|
-
background: props => props.background ? ({
|
|
67
|
+
background: props => props.background ? ({ background: getColor(props.background) }) : null,
|
|
68
68
|
|
|
69
69
|
textStroke: props => props.textStroke ? diffStroke(props.textStroke) : null,
|
|
70
70
|
|
package/src/set.js
ADDED
|
@@ -10,7 +10,8 @@ export const transformClassname = props => {
|
|
|
10
10
|
|
|
11
11
|
for (const key in props) {
|
|
12
12
|
const setter = keySetters[key.slice(0, 1)]
|
|
13
|
-
const
|
|
13
|
+
const reg = registry
|
|
14
|
+
const hasCSS = reg[key]
|
|
14
15
|
|
|
15
16
|
if (setter) setter(key, props[key], CLASS_NAMES)
|
|
16
17
|
else if (isFunction(hasCSS)) merge(CLASS_NAMES, hasCSS(props))
|
package/src/transform/emotion.js
CHANGED
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
import { isFunction } from '@domql/utils'
|
|
3
4
|
import createEmotion from '@emotion/css/create-instance'
|
|
4
|
-
// const ENV = process.env.NODE_ENV
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
flush,
|
|
8
|
-
hydrate,
|
|
9
|
-
cx,
|
|
10
|
-
getRegisteredStyles,
|
|
11
|
-
injectGlobal,
|
|
12
|
-
keyframes,
|
|
13
|
-
css,
|
|
14
|
-
sheet,
|
|
15
|
-
cache
|
|
16
|
-
} = createEmotion({
|
|
6
|
+
const { css } = createEmotion({
|
|
17
7
|
key: 'smbls'
|
|
18
8
|
})
|
|
19
9
|
|
|
20
|
-
export const transformEmotion = props => css(props)
|
|
10
|
+
export const transformEmotion = (props, callback) => isFunction(callback) ? callback(props) : css(props)
|