You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.9 KiB

4 years ago
  1. [![Build Status][ci-img]][ci] [![codecov][codecov-img]][codecov] [![npm][npm-img]][npm]
  2. # CSS Modules: Local by Default
  3. Transformation examples:
  4. ```css
  5. .foo { ... } /* => */ :local(.foo) { ... }
  6. .foo .bar { ... } /* => */ :local(.foo) :local(.bar) { ... }
  7. /* Shorthand global selector */
  8. :global .foo .bar { ... } /* => */ .foo .bar { ... }
  9. .foo :global .bar { ... } /* => */ :local(.foo) .bar { ... }
  10. /* Targeted global selector */
  11. :global(.foo) .bar { ... } /* => */ .foo :local(.bar) { ... }
  12. .foo:global(.bar) { ... } /* => */ :local(.foo).bar { ... }
  13. .foo :global(.bar) .baz { ... } /* => */ :local(.foo) .bar :local(.baz) { ... }
  14. .foo:global(.bar) .baz { ... } /* => */ :local(.foo).bar :local(.baz) { ... }
  15. ```
  16. ## Building
  17. ```bash
  18. $ npm install
  19. $ npm test
  20. ```
  21. - Build: [![Build Status][ci-img]][ci]
  22. - Lines: [![coveralls][coveralls-img]][coveralls]
  23. - Statements: [![codecov][codecov-img]][codecov]
  24. ## Development
  25. ```bash
  26. $ npm run autotest
  27. ```
  28. ## License
  29. MIT
  30. ## With thanks
  31. - [Tobias Koppers](https://github.com/sokra)
  32. - [Glen Maddern](https://github.com/geelen)
  33. ---
  34. Mark Dalgleish, 2015.
  35. [ci-img]: https://img.shields.io/travis/css-modules/postcss-modules-local-by-default/master.svg?style=flat-square
  36. [ci]: https://travis-ci.org/css-modules/postcss-modules-local-by-default
  37. [npm-img]: https://img.shields.io/npm/v/postcss-modules-local-by-default.svg?style=flat-square
  38. [npm]: https://www.npmjs.com/package/postcss-modules-local-by-default
  39. [coveralls-img]: https://img.shields.io/coveralls/css-modules/postcss-modules-local-by-default/master.svg?style=flat-square
  40. [coveralls]: https://coveralls.io/r/css-modules/postcss-modules-local-by-default?branch=master
  41. [codecov-img]: https://img.shields.io/codecov/c/github/css-modules/postcss-modules-local-by-default/master.svg?style=flat-square
  42. [codecov]: https://codecov.io/github/css-modules/postcss-modules-local-by-default?branch=master