Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
postcss-local-constants
Advanced tools
PostCSS plugin to process imported constants from a file, removing them from a global scope.
PostCSS plugin to process imported constants from a file, removing them from a global scope.
constants.js
module.exports = {
colors: {
primary: '#8EE7D3',
},
};
input
~colors: "./constants.json";
.foo {
color: primary from ~colors;
}
output
.foo {
color: #8EE7D3;
}
constants.js
module.exports = {
borders: {
weight: '2px',
style: 'solid',
},
};
input
~borders: "./constants.json";
.foo {
border: weight from ~borders style from ~borders black;
}
output
.foo {
border: 2px solid black;
}
constants.js
module.exports = {
queries: {
maxWidth: '200px',
},
}
input
~queries: "./constants.json";
@media (max-width: maxWidth from ~queries) {
color: blue;
}
output
@media (max-width: 200px) {
color: blue;
}
postcss([ require('postcss-local-constants') ])
You can pass a default set of constants (that can be overriden), if you want to update default constants in webpack hot reload:
postcss([
localConsts({
defaults: {
colors: {
primary: 'blue',
},
}
})
])
Call postcss-local-constants
before any plugins that will compute values stored in constants. See PostCSS docs for examples for your environment.
0.0.5
lodash
is used directly rather than lodash-node
FAQs
PostCSS plugin to process imported constants from a file, removing them from a global scope.
The npm package postcss-local-constants receives a total of 1 weekly downloads. As such, postcss-local-constants popularity was classified as not popular.
We found that postcss-local-constants 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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.