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

list-css-selectors

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

list-css-selectors

List all the selectors in your CSS files(s).

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

List CSS Selectors

A simple way to list all the selectors used in your CSS file(s).

Installation

Via npm:

npm i list-css-selectors

Usage

Your CSS file:

div { display: block; }

#some-id { color: red; }
.some-class { color: white; }
.hover:hover { color: blue; }

[data-noval] { opacity: 0; }
[data-test='ok'] { opacity: 1; }

@keyframes softblink {
  0% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
  .selector-in-media-query { width: 100%; }
}

Run list-css-selectors:

const listSelectors = require('list-css-selectors');
const { resolve } = require('path');
const pathToMyFile = resolve(resolve(), './styles.css');
const selectors = listSelectors(pathToMyFile);

The results of selectors will be:

[
  'div',
  '#some-id',
  '.some-class',
  '.hover::hover',
  '[data-noval]',
  '[data-test=\'ok\']',
  'softblink',
  '.selector-in-media-query'
]

Keywords

FAQs

Package last updated on 05 May 2018

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