You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

alga-css

Package Overview
Dependencies
Maintainers
1
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alga-css - npm Package Compare versions

Comparing version

to
1.0.0-wood-9

2

package.json
{
"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