New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

minify-selectors

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minify-selectors

Post-processor that minifies classes and IDs in CSS, HTML and Javascript files.

  • 0.4.2
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

minify-selectors

Post-processor that minifies classes and IDs in CSS, HTML and Javascript files.

Each unique identifier is assigned an index which is converted into an ultra compact CSS valid selector.

Examples

CSS (source):

#page--default { … }
.sidebar, .site-nav { … }
.sidebar .search:focus-within { … }
.sidebar--expanded a.is-active { … }

CSS (output):

#AA { … }
.AB, .AC { … }
.AB .AD:focus-within { … }
.AE a.AD { … }

HTML (source):

<main id="page--default">
    <nav class="site-nav">
        <div class="search has-content">
            <label for="site-search" class="text--muted text--center"></label>
            <input type="text" id="site-search" class="form-input--single form-input--lg border--thick">
        </div>
    </nav>
</main>

HTML (output):

<main id="AA">
    <nav class="AC">
        <div class="AD B2">
            <label for="Ay" class="D3 D4"></label>
            <input type="text" id="Ay" class="C9 CH Di">
        </div>
    </nav>
</main>

JS (source)

for (let link of document.querySelectorAll('a.anchor')) {
    link.classList.remove('is-active');
}

JS (output)

for (let link of document.querySelectorAll('a.Bd')) {
    link.classList.remove('AD');
}

For a full outline of capabilities and current limitations, see TODO

Usage

Install from npm

npm i minify-selectors

Running in the command line

minify-selectors --input "example/dir/src" --output "example/dir/dist"

For more CLI options, see the 'Options' section below.

Options

Keywords

FAQs

Package last updated on 16 Apr 2022

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