|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.8 KB
|
| Line | |
|---|
| 1 | # CSS Modules: Extract Imports
|
|---|
| 2 |
|
|---|
| 3 | [](https://travis-ci.org/css-modules/postcss-modules-extract-imports)
|
|---|
| 4 |
|
|---|
| 5 | Transforms:
|
|---|
| 6 |
|
|---|
| 7 | ```css
|
|---|
| 8 | :local(.continueButton) {
|
|---|
| 9 | composes: button from "library/button.css";
|
|---|
| 10 | color: green;
|
|---|
| 11 | }
|
|---|
| 12 | ```
|
|---|
| 13 |
|
|---|
| 14 | into:
|
|---|
| 15 |
|
|---|
| 16 | ```css
|
|---|
| 17 | :import("library/button.css") {
|
|---|
| 18 | button: __tmp_487387465fczSDGHSABb;
|
|---|
| 19 | }
|
|---|
| 20 | :local(.continueButton) {
|
|---|
| 21 | composes: __tmp_487387465fczSDGHSABb;
|
|---|
| 22 | color: green;
|
|---|
| 23 | }
|
|---|
| 24 | ```
|
|---|
| 25 |
|
|---|
| 26 | ## Specification
|
|---|
| 27 |
|
|---|
| 28 | - Only a certain whitelist of properties are inspected. Currently, that whitelist is `['composes']` alone.
|
|---|
| 29 | - An extend-import has the following format:
|
|---|
| 30 |
|
|---|
| 31 | ```
|
|---|
| 32 | composes: className [... className] from "path/to/file.css", className [... className], className [... className] from global;
|
|---|
| 33 | ```
|
|---|
| 34 |
|
|---|
| 35 | ## Options
|
|---|
| 36 |
|
|---|
| 37 | - `failOnWrongOrder` `bool` generates exception for unpredictable imports order.
|
|---|
| 38 |
|
|---|
| 39 | ```css
|
|---|
| 40 | .aa {
|
|---|
| 41 | composes: b from "./b.css";
|
|---|
| 42 | composes: c from "./c.css";
|
|---|
| 43 | }
|
|---|
| 44 |
|
|---|
| 45 | .bb {
|
|---|
| 46 | /* "b.css" should be before "c.css" in this case */
|
|---|
| 47 | composes: c from "./c.css";
|
|---|
| 48 | composes: b from "./b.css";
|
|---|
| 49 | }
|
|---|
| 50 | ```
|
|---|
| 51 |
|
|---|
| 52 | ## Building
|
|---|
| 53 |
|
|---|
| 54 | ```
|
|---|
| 55 | npm install
|
|---|
| 56 | npm test
|
|---|
| 57 | ```
|
|---|
| 58 |
|
|---|
| 59 | [](https://travis-ci.org/css-modules/postcss-modules-extract-imports)
|
|---|
| 60 |
|
|---|
| 61 | - Lines: [](https://coveralls.io/r/css-modules/postcss-modules-extract-imports?branch=master)
|
|---|
| 62 | - Statements: [](http://codecov.io/github/css-modules/postcss-modules-extract-imports?branch=master)
|
|---|
| 63 |
|
|---|
| 64 | ## License
|
|---|
| 65 |
|
|---|
| 66 | ISC
|
|---|
| 67 |
|
|---|
| 68 | ## With thanks
|
|---|
| 69 |
|
|---|
| 70 | - Mark Dalgleish
|
|---|
| 71 | - Tobias Koppers
|
|---|
| 72 | - Guy Bedford
|
|---|
| 73 |
|
|---|
| 74 | ---
|
|---|
| 75 |
|
|---|
| 76 | Glen Maddern, 2015.
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.