Comparing version 1.0.0-wood-8 to 1.0.0-wood-9
{ | ||
"name": "alga-css", | ||
"version": "1.0.0-wood-8", | ||
"version": "1.0.0-wood-9", | ||
"description": "Alga CSS is a scope-first CSS toolkit for quickly mix or compose CSS references and share CSS properties between components", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -26,5 +26,14 @@ const postcss = require('postcss') | ||
if(val.trim().startsWith('{') && val.trim().endsWith('}')) { | ||
declVal = postcss.decl({ prop: key.trim(), value: props[val.replace('{', '').replace('}', '').trim()] }) | ||
} else if(val.trim().startsWith('props{') && val.trim().endsWith('}')) { | ||
declVal = postcss.decl({ prop: key.trim(), value: props[val.replace('{', '').replace('}', '').trim()] }) | ||
let newDeclVal = val.replace('{', '').replace('}', '').trim() | ||
const splitDeclVal = newDeclVal.split(/\(|\)|\s|,/g).filter(i => i !== '') | ||
if(Number(splitDeclVal.length) === 1) { | ||
declVal = postcss.decl({ prop: key.trim(), value: props[newDeclVal] }) | ||
} else { | ||
for(let splittedDecl of splitDeclVal) { | ||
if(props[splittedDecl]) { | ||
newDeclVal = newDeclVal.replaceAll(splittedDecl, props[splittedDecl]) | ||
} | ||
} | ||
declVal = postcss.decl({ prop: key.trim(), value: newDeclVal }) | ||
} | ||
} else { | ||
@@ -31,0 +40,0 @@ declVal = postcss.decl({ prop: key.trim(), value: val.trim() }) |
Sorry, the diff of this file is not supported yet
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
64902
723