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 CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Utilize props as CSS methods",
4
4
  "private": false,
5
5
  "author": "symbo.ls",
6
- "version": "0.9.3",
6
+ "version": "0.9.4",
7
7
  "repository": "https://github.com/symbo-ls/smbls",
8
8
  "main": "src/index.js",
9
9
  "files": [
package/src/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use strict'
2
2
 
3
- export { set } from '@symbo.ls/scratch'
4
3
  export * from './transform'
4
+ export * from './set'
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 ? ({ backgroundColor: getColor(props.background) }) : null,
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
@@ -0,0 +1,8 @@
1
+ 'use strict'
2
+
3
+ import { transformClassname, transformEmotion } from './transform'
4
+
5
+ export const setClassname = (props, emotionCss) => {
6
+ const transform = transformClassname(props)
7
+ return transformEmotion(transform, emotionCss)
8
+ }
@@ -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 hasCSS = registry[key]
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))
@@ -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
- export const {
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)
@@ -1,5 +1,5 @@
1
1
  'use strict'
2
2
 
3
- export * from './emotion'
4
3
  export * from './classname'
4
+ export * from './emotion'
5
5
  export * from './subProps'