Comparing version 0.2.2 to 0.2.3
@@ -112,6 +112,7 @@ "use strict" | ||
const { propsKeys, styleKeys } = renderer.options | ||
const transform = (styleObject, theme) => { | ||
const renderedStyle = renderer(Object.assign({ theme }, styleObject)) | ||
const transform = (style, theme) => { | ||
if (!isPlainObject(style)) return null | ||
const renderedStyle = renderer(Object.assign({ theme }, style)) | ||
const mergedStyle = renderedStyle && merge(renderedStyle) | ||
return Object.keys(styleObject).reduce((result, key) => { | ||
return Object.keys(style).reduce((result, key) => { | ||
const value = result[key] | ||
@@ -126,3 +127,3 @@ if (isPlainObject(value)) { | ||
return result | ||
}, Object.assign({}, styleObject, mergedStyle)) | ||
}, Object.assign({}, style, mergedStyle)) | ||
} | ||
@@ -129,0 +130,0 @@ Object.defineProperty(transform, "name", { value: name }) |
@@ -108,6 +108,7 @@ const PX_SCALE = [0, 2, 4, 8, 16, 32, 64, 128, 256, 512] | ||
const { propsKeys, styleKeys } = renderer.options | ||
const transform = (styleObject, theme) => { | ||
const renderedStyle = renderer(Object.assign({ theme }, styleObject)) | ||
const transform = (style, theme) => { | ||
if (!isPlainObject(style)) return null | ||
const renderedStyle = renderer(Object.assign({ theme }, style)) | ||
const mergedStyle = renderedStyle && merge(renderedStyle) | ||
return Object.keys(styleObject).reduce((result, key) => { | ||
return Object.keys(style).reduce((result, key) => { | ||
const value = result[key] | ||
@@ -122,3 +123,3 @@ if (isPlainObject(value)) { | ||
return result | ||
}, Object.assign({}, styleObject, mergedStyle)) | ||
}, Object.assign({}, style, mergedStyle)) | ||
} | ||
@@ -125,0 +126,0 @@ Object.defineProperty(transform, "name", { value: name }) |
{ | ||
"name": "onno", | ||
"license": "MIT", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Responsive style props for building themed design systems", | ||
@@ -33,3 +33,3 @@ "homepage": "https://github.com/wagerfield/onno/tree/master/packages/onno#readme", | ||
}, | ||
"gitHead": "911b932b1c77fab544d8f2dc4ae097956742043a" | ||
"gitHead": "3c92f182255e7f5a620870201db0f5d47d1c78c9" | ||
} |
@@ -107,3 +107,3 @@ export declare type Length = number | ||
export interface StyleTransformFunction<P extends ThemeProps, S extends Style> { | ||
(style: StyleObject<S>, theme?: Theme): StyleObject<S> | ||
(style?: StyleObject<S>, theme?: Theme): StyleObject<S> | null | ||
renderer: ComposedRenderFunction<P, S> | ||
@@ -110,0 +110,0 @@ options: InterpolateOptions |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
111107
3804