epiphany/node_modules/@csstools/postcss-scope-pseudo-class
2023-12-09 22:48:07 -08:00
..
dist stylelint/eleventy config 2023-12-09 22:48:07 -08:00
CHANGELOG.md stylelint/eleventy config 2023-12-09 22:48:07 -08:00
LICENSE.md stylelint/eleventy config 2023-12-09 22:48:07 -08:00
package.json stylelint/eleventy config 2023-12-09 22:48:07 -08:00
README.md stylelint/eleventy config 2023-12-09 22:48:07 -08:00

PostCSS Scope Pseudo Class PostCSS Logo

npm version CSS Standard Status Build Status Discord

PostCSS Scope Pseudo Class lets you use the :scope Pseudo-class following the Selectors 4 specification.

:scope {
	color: green;
}

/* becomes */

:root {
	color: green;
}

Usage

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 */);

PostCSS Scope Pseudo Class runs in all Node environments, with special instructions for:

Options

preserve

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;
}