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

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin