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

postcss-icss-selectors

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-icss-selectors

PostCSS plugin for css modules to local-scope classes and ids

  • 2.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
48K
increased by0.23%
Maintainers
1
Weekly downloads
 
Created
Source

postcss-icss-selectors Build Status

PostCSS plugin for css modules to local-scope classes and ids

Usage

postcss([ require('postcss-icss-selectors')(options) ])

See PostCSS docs for examples for your environment.

Options

mode

local by default or global

In local mode

.foo { ... } /* => */ .file__foo---h63h { ... }

.foo .bar { ... } /* => */ .file__foo----h63h .file__bar----h63h { ... }

/* Shorthand global selector */

:global .foo .bar { ... } /* => */ .foo .bar { ... }

.foo :global .bar { ... } /* => */ .file__foo----h63h .bar { ... }

/* Targeted global selector */

:global(.foo) .bar { ... } /* => */ .foo .file__bar----h63h { ... }

.foo:global(.bar) { ... } /* => */ .file__foo----h63h.bar { ... }

.foo :global(.bar) .baz { ... } /* => */ .file__foo----h63h .bar .file__baz----h63h { ... }

.foo:global(.bar) .baz { ... } /* => */ .file__foo----h63h.bar .file__baz----h63h { ... }

In global mode

.foo { ... } /* => */ .foo { ... }

.foo .bar { ... } /* => */ .foo .bar { ... }

/* Shorthand local selector */

:local .foo :global .bar { ... } /* => */ .file__foo----h63h .bar { ... }

.foo :local .bar { ... } /* => */ .foo .file__foo----h63h { ... }

/* Targeted local selector */

:local(.foo) .bar { ... } /* => */ .file__foo----h63h .bar { ... }

.foo:local(.bar) { ... } /* => */ .foo.file__bar----h63h { ... }

generateScopeName(localName, filepath, css)

Converts every new local name in #id or .class defintion to global alias. By default returns [name]__[local]---[hash:base64:5].

Messages

postcss-icss-selectors passes result.messages for each local-scoped class or id

{
  plugin: 'postcss-icss-selectors',
  type: 'icss-scoped',
  name: string, // local-scoped identifier
  value: string // generated global identifier
}

License

MIT © Mark Dalgleish and Bogdan Chadkin, 2015

Keywords

FAQs

Package last updated on 21 Jun 2017

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