
Security News
Security Community Slams MIT-linked Report Claiming AI Powers 80% of Ransomware
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.
@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
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.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.