Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

postcss-custom-selectors

Package Overview
Dependencies
1
Maintainers
5
Versions
21
Issues
File Explorer

Advanced tools

postcss-custom-selectors

Use Custom Selectors in CSS

    7.0.0latest

Version published
Maintainers
5
Weekly downloads
6,801,743
decreased by-14.69%

Weekly downloads

Readme

Source

PostCSS Custom Selectors PostCSS Logo

npm version CSS Standard Status Build Status Discord

PostCSS Custom Selectors lets you define @custom-selector in CSS following the Custom Selectors Specification.

@custom-selector :--heading h1, h2, h3; article :--heading + p { margin-top: 0; } /* becomes */ article :is(h1, h2, h3) + p { margin-top: 0; }

Usage

Add PostCSS Custom Selectors to your project:

npm install postcss postcss-custom-selectors --save-dev

Use it as a PostCSS plugin:

const postcss = require('postcss'); const postcssCustomSelectors = require('postcss-custom-selectors'); postcss([ postcssCustomSelectors(/* pluginOptions */) ]).process(YOUR_CSS /*, processOptions */);

PostCSS Custom Selectors runs in all Node environments, with special instructions for:

NodePostCSS CLIWebpackCreate React AppGulpGrunt

Options

preserve

The preserve option determines whether the original notation is preserved. By default, it is not preserved.

postcssCustomSelectors({ preserve: true }) @custom-selector :--heading h1, h2, h3; article :--heading + p { margin-top: 0; } /* becomes */ @custom-selector :--heading h1, h2, h3; article :is(h1, h2, h3) + p { margin-top: 0; } article :--heading + p { margin-top: 0; }

Keywords

FAQs

What is postcss-custom-selectors?

Use Custom Selectors in CSS

Is postcss-custom-selectors popular?

The npm package postcss-custom-selectors receives a total of 5,460,614 weekly downloads. As such, postcss-custom-selectors popularity was classified as popular.

Is postcss-custom-selectors well maintained?

We found that postcss-custom-selectors demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 5 open source maintainers collaborating on the project.

Last updated on 14 Nov 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc