
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
postcss-prune-var
Advanced tools
PostCSS plugin to remove all unused variables in a CSS file.
A --variable is considered unused if it, or any other variables consuming it are not accessed by a single var() statement in the whole CSS file.
This is unsafe if there is a possibility of a second CSS file accessing variables from the first one.
postcss-unused-var is outdated, deprecated, and didn't work right.:root.var() by following variable dependency graph.npm install postcss-prune-var --save-dev
const pruneVar = require('postcss-prune-var');
const yourConfig = {
plugins: [pruneVar()],
};
Use this option to exclude certain files or folders that would otherwise be scanned.
const pruneVar = require('postcss-prune-var');
const yourConfig = {
plugins: [pruneVar({skip: ['node_modules/**']})],
};
Input:
:root {
--root-unused: red;
--root-unused-proxy: var(--root-unused);
--root-used: blue;
}
.foo {
--unused: red;
--unused-proxy: var(--unused);
--proxied: pink;
--proxy: var(--proxied);
--used: green;
color: var(--root-used);
background: linear-gradient(to bottom, var(--used), var(--proxy));
}
Output
:root {
--root-used: blue;
}
.foo {
--proxied: pink;
--proxy: var(--proxied);
--used: green;
color: var(--root-used);
background: linear-gradient(to bottom, var(--used), var(--proxy));
}
FAQs
PostCSS plugin to remove unused variables
We found that postcss-prune-var 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
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.