1. postcss-modules-local-by-default
A CSS Modules transform to make local scope the default
postcss-modules-local-by-default
Package: postcss-modules-local-by-default
Created by: css-modules
Last modified: Wed, 03 Apr 2024 11:08:24 GMT
Version: 4.0.5
License: MIT
Downloads: 76,385,033
Repository: https://github.com/css-modules/postcss-modules-local-by-default

Install

npm install postcss-modules-local-by-default
yarn add postcss-modules-local-by-default

Build Status codecov npm

CSS Modules: Local by Default

Transformation examples:

 .foo { ... } /* => */ :local(.foo) { ... }

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

/* Shorthand global selector */

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

.foo :global .bar { ... } /* => */ :local(.foo) .bar { ... }

/* Targeted global selector */

:global(.foo) .bar { ... } /* => */ .foo :local(.bar) { ... }

.foo:global(.bar) { ... } /* => */ :local(.foo).bar { ... }

.foo :global(.bar) .baz { ... } /* => */ :local(.foo) .bar :local(.baz) { ... }

.foo:global(.bar) .baz { ... } /* => */ :local(.foo).bar :local(.baz) { ... }

Building

 $ npm install
$ npm test
  • Build: Build Status
  • Lines: coveralls
  • Statements: codecov

Development

 $ yarn test:watch

License

MIT

With thanks


Mark Dalgleish, 2015.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code