
Research
/Security News
Popular Tinycolor npm Package Compromised in Supply Chain Attack Affecting 40+ Packages
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
css-expression
Advanced tools
$ npm install css-expression
import { parse } from 'css-expression'
// Simple example
const expr1 = parse('linear-gradient(90deg, #f00 0%, #000 100%)');
// Complex example
const expr2 = parse('10px ((((800)))) hui(200, 500, rgba(400, 20, 55, 0.5), dont(trust(23, 42, verify), 10000)) (100 (foo bar gay vibes( ss, 10px)) 200 30) 100% hahah was geht 1.6em 2 / span 1 ');
import { stringify } from 'css-expression'
// Simple example
const str1 = (stringify({
type: 'function',
name: 'rgb',
args: [
{ type: 'primitive', value: 255, unit: null },
{ type: 'primitive', value: 0, unit: null },
{ type: 'primitive', value: 138, unit: null }
]
}); // => rgb(255, 0, 138)
// Complex example
const str2 = stringify({
type: 'expression',
literals: [
{
type: 'function',
name: 'holy',
args: [
{
type: 'expression',
literals: [
{ type: 'primitive', value: 'fucking', unit: null },
{ type: 'primitive', value: 99, unit: 'px' }
]
},
{
type: 'function',
name: 'bee',
args: [
{
type: 'expression',
literals: [
{ type: 'primitive', value: 42, unit: '%' },
{ type: 'primitive', value: 'cool', unit: null }
]
},
{ type: 'primitive', value: 'funny', unit: null }
]
}
]
},
{
type: 'expression',
literals: [
{ type: 'primitive', value: 'all', unit: null },
{ type: 'primitive', value: 'good', unit: null },
{ type: 'primitive', value: 20, unit: 'em' }
]
}
]
}); // => holy(fucking 99px, bee(42% cool, funny)) (all good 20em)
FAQs
Parse & stringify css expressions
The npm package css-expression receives a total of 16 weekly downloads. As such, css-expression popularity was classified as not popular.
We found that css-expression demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.