@csstools/postcss-scope-pseudo-class
TypeScript icon, indicating that this package has built-in type declarations

4.0.1 • Public • Published

PostCSS Scope Pseudo Class PostCSS Logo

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

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

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

Package Sidebar

Install

npm i @csstools/postcss-scope-pseudo-class

Weekly Downloads

1,142,596

Version

4.0.1

License

MIT-0

Unpacked Size

6.23 kB

Total Files

7

Last publish

Collaborators

  • romainmenke
  • alaguna
  • jonathantneal