@nozbe/zacs
Advanced tools
Comparing version 1.1.0-12 to 1.1.0-13
{ | ||
"name": "@nozbe/zacs", | ||
"version": "1.1.0-12", | ||
"version": "1.1.0-13", | ||
"description": "Zero Abstraction Cost Styling (for React DOM and React Native)", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -761,5 +761,14 @@ /* eslint-disable no-use-before-define */ | ||
properties.forEach(property => { | ||
if (t.isSpreadElement(property.node)) { | ||
const spreadArg = property.get('argument') | ||
if (!t.isObjectExpression(spreadArg.node)) { | ||
throw spreadArg.buildCodeFrameError("Spread element in a ZACS StyleSheet must be a simple object literal, like so: `{ height: 100, ...{ width: 200 } }`. Other syntaxes, like `...styles` are not allowed.") | ||
} | ||
validateStyleset(t, spreadArg) | ||
return | ||
} | ||
if (!isPlainObjectProperty(t, property.node, true)) { | ||
throw property.buildCodeFrameError( | ||
'ZACS StyleSheets style attributes must be simple strings, like so: `{ backgroundColor: \'red\', height: 100 }`. Other syntaxes, like `[propName]:`, `...styles` are not allowed.', | ||
'ZACS StyleSheets style attributes must be simple strings, like so: `{ backgroundColor: \'red\', height: 100 }`. Other syntaxes, like `[propName]:` are not allowed.', | ||
) | ||
@@ -855,2 +864,6 @@ } | ||
function encodeCSSStyle(property, spaces = ' ') { | ||
if (property.type === 'SpreadElement') { | ||
return encodeCSSStyles(property.argument, spaces) | ||
} | ||
const { value } = property | ||
@@ -907,2 +920,7 @@ | ||
styleset.value.properties.forEach(property => { | ||
if (property.type === 'SpreadElement') { | ||
pushFromInner(property.argument) | ||
return | ||
} | ||
const key = property.key.name | ||
@@ -909,0 +927,0 @@ if (key === 'web' || key === 'css') { |
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
83795
1433