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.

63 lines
1.6 KiB

4 years ago
  1. # CSS Modules: Extract Imports
  2. [![Build Status](https://travis-ci.org/css-modules/postcss-modules-extract-imports.svg?branch=master)](https://travis-ci.org/css-modules/postcss-modules-extract-imports)
  3. Transforms:
  4. ```css
  5. :local(.continueButton) {
  6. composes: button from "library/button.css";
  7. color: green;
  8. }
  9. ```
  10. into:
  11. ```css
  12. :import("library/button.css") {
  13. button: __tmp_487387465fczSDGHSABb;
  14. }
  15. :local(.continueButton) {
  16. composes: __tmp_487387465fczSDGHSABb;
  17. color: green;
  18. }
  19. ```
  20. ## Specification
  21. - Only a certain whitelist of properties are inspected. Currently, that whitelist is `['composes']` alone.
  22. - An extend-import has the following format:
  23. ```
  24. composes: className [... className] from "path/to/file.css";
  25. ```
  26. ## Building
  27. ```
  28. npm install
  29. npm build
  30. npm test
  31. ```
  32. [![Build Status](https://travis-ci.org/css-modules/postcss-modules-extract-imports.svg?branch=master)](https://travis-ci.org/css-modules/postcss-modules-extract-imports)
  33. * Lines: [![Coverage Status](https://coveralls.io/repos/css-modules/postcss-modules-extract-imports/badge.svg?branch=master)](https://coveralls.io/r/css-modules/postcss-modules-extract-imports?branch=master)
  34. * Statements: [![codecov.io](http://codecov.io/github/css-modules/postcss-modules-extract-imports/coverage.svg?branch=master)](http://codecov.io/github/css-modules/postcss-modules-extract-imports?branch=master)
  35. ## Development
  36. - `npm watch` will watch `src` for changes and rebuild
  37. - `npm autotest` will watch `src` and `test` for changes and retest
  38. ## License
  39. ISC
  40. ## With thanks
  41. - Mark Dalgleish
  42. - Tobias Koppers
  43. - Guy Bedford
  44. ---
  45. Glen Maddern, 2015.