Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-unique-selectors

Package Overview
Dependencies
Maintainers
5
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-unique-selectors

Ensure CSS selectors are unique.

  • 4.0.0-nightly.2020.7.25
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.3M
decreased by-14.87%
Maintainers
5
Weekly downloads
 
Created

What is postcss-unique-selectors?

The postcss-unique-selectors npm package is a PostCSS plugin that removes duplicate CSS selectors within a rule. This helps in optimizing the CSS by ensuring that each selector is unique, which can reduce the size of the CSS file and improve maintainability.

What are postcss-unique-selectors's main functionalities?

Remove duplicate selectors

This feature removes duplicate selectors within a CSS rule. In the provided code sample, the duplicate 'a' selector is removed, resulting in 'a, b { color: red; }'.

const postcss = require('postcss');
const uniqueSelectors = require('postcss-unique-selectors');

const css = 'a, a, b { color: red; }';

postcss([uniqueSelectors])
  .process(css)
  .then(result => {
    console.log(result.css); // Output: 'a, b { color: red; }'
  });

Other packages similar to postcss-unique-selectors

Keywords

FAQs

Package last updated on 25 Jul 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc