
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
@csstools/postcss-scope-pseudo-class
Advanced tools
npm install @csstools/postcss-scope-pseudo-class --save-dev
PostCSS Scope Pseudo Class lets you use the :scope Pseudo-class following the Selectors 4 specification.
:scope {
color: green;
}
/* becomes */
:root {
color: green;
}
Add PostCSS Scope Pseudo Class to your project:
npm install postcss @csstools/postcss-scope-pseudo-class --save-dev
Use it as a PostCSS plugin:
const postcss = require('postcss');
const postcssScopePseudoClass = require('@csstools/postcss-scope-pseudo-class');
postcss([
postcssScopePseudoClass(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
The preserve option determines whether the original notation
is preserved. By default, it is not preserved.
postcssScopePseudoClass({ preserve: true })
:scope {
color: green;
}
/* becomes */
:root {
color: green;
}
:scope {
color: green;
}
postcss-nested is a PostCSS plugin that allows you to nest your CSS selectors in a way that follows the same visual hierarchy of your HTML. While it doesn't specifically scope pseudo-classes, it helps in organizing and scoping styles in a nested manner, which can indirectly achieve similar results.
postcss-custom-selectors is a PostCSS plugin that allows you to define custom selectors. This can be used to create more complex and reusable selectors, including those involving pseudo-classes. However, it requires more manual setup compared to @csstools/postcss-scope-pseudo-class.
postcss-preset-env allows you to use future CSS features today, including custom properties and nesting. While it doesn't specifically focus on scoping pseudo-classes, it provides a wide range of modern CSS features that can help in managing styles more effectively.
FAQs
The Reference Element Pseudo-class: :scope
The npm package @csstools/postcss-scope-pseudo-class receives a total of 652,174 weekly downloads. As such, @csstools/postcss-scope-pseudo-class popularity was classified as popular.
We found that @csstools/postcss-scope-pseudo-class 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.

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.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.