
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
postcss-value-parser
Advanced tools
Transforms css values and at-rule params into the tree
var parser = require('postcss-value-parser');
/*{
nodes: [
type: 'function',
value: 'rgba',
nodes: [
{ type: 'word', value: '233' },
{ type: 'div', value: ',', before: '', after: ' ' },
{ type: 'word', value: '45' },
{ type: 'div', value: ',', before: '', after: ' ' },
{ type: 'word', value: '66' },
{ type: 'div', value: ',', before: ' ', after: '' },
{ type: 'word', value: '.5' }
]
]
}*/
parser('rgba(233, 45, 66 ,.5)')
.walk('rgba', function (fn) {
var color = fn.filter(function (node) {
return node.type === 'word';
}); // [233, 45, 66, .5]
fn.type = 'word';
fn.value = convertToHex(color);
})
.toString();
// #E92D42
parser('url(some url) 50% 50%')
.walk(function (node) {
// Your code
if (node.type === 'function' && node.value === 'url') {
return false;
}
})
.toString();
{ type: 'word', value: 'any' }{ type: 'string', value: 'string', quote: '"' || '\'' }{ type: 'div', value: '/' || ',' || ':', before: ' ', after: ' ' }{ type: 'space', value: ' ' } space as a separator{ type: 'function', value: 'name', nodes: [] }var parser = require('postcss-value-parser');
Returns parsed value
// .2rem
{
number: '.2',
unit: 'rem'
}
Trims space nodes (modifies original array and returns reference on it)
Stringifies node and array of nodes
Returns parsed tree
Root nodes list
Stringify tree to the value
name value filtercb(node, index, nodes)reverse walk to the deepest functions firstlyMIT © Bogdan Chadkin
css-value-parser is a package that offers similar functionality to postcss-value-parser. It can parse CSS property values into JavaScript objects. However, it may not have as rich an API for manipulation or walking through the parsed values as postcss-value-parser.
css-tree is a more comprehensive CSS parser that can parse entire stylesheets and includes the ability to parse individual values. It differs from postcss-value-parser in that it is designed to handle full CSS parsing and AST manipulation, not just values.
FAQs
Transforms css values and at-rule params into the tree
The npm package postcss-value-parser receives a total of 0 weekly downloads. As such, postcss-value-parser popularity was classified as not popular.
We found that postcss-value-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.