1 | [![Build Status][ci-img]][ci] [![codecov][codecov-img]][codecov] [![npm][npm-img]][npm]
|
---|
2 |
|
---|
3 | # CSS Modules: Local by Default
|
---|
4 |
|
---|
5 | Transformation examples:
|
---|
6 |
|
---|
7 | <!-- prettier-ignore-start -->
|
---|
8 | ```css
|
---|
9 | .foo { ... } /* => */ :local(.foo) { ... }
|
---|
10 |
|
---|
11 | .foo .bar { ... } /* => */ :local(.foo) :local(.bar) { ... }
|
---|
12 |
|
---|
13 | /* Shorthand global selector */
|
---|
14 |
|
---|
15 | :global .foo .bar { ... } /* => */ .foo .bar { ... }
|
---|
16 |
|
---|
17 | .foo :global .bar { ... } /* => */ :local(.foo) .bar { ... }
|
---|
18 |
|
---|
19 | /* Targeted global selector */
|
---|
20 |
|
---|
21 | :global(.foo) .bar { ... } /* => */ .foo :local(.bar) { ... }
|
---|
22 |
|
---|
23 | .foo:global(.bar) { ... } /* => */ :local(.foo).bar { ... }
|
---|
24 |
|
---|
25 | .foo :global(.bar) .baz { ... } /* => */ :local(.foo) .bar :local(.baz) { ... }
|
---|
26 |
|
---|
27 | .foo:global(.bar) .baz { ... } /* => */ :local(.foo).bar :local(.baz) { ... }
|
---|
28 | ```
|
---|
29 | <!-- prettier-ignore-end -->
|
---|
30 |
|
---|
31 | ## Building
|
---|
32 |
|
---|
33 | ```bash
|
---|
34 | $ npm install
|
---|
35 | $ npm test
|
---|
36 | ```
|
---|
37 |
|
---|
38 | - Build: [![Build Status][ci-img]][ci]
|
---|
39 | - Lines: [![coveralls][coveralls-img]][coveralls]
|
---|
40 | - Statements: [![codecov][codecov-img]][codecov]
|
---|
41 |
|
---|
42 | ## Development
|
---|
43 |
|
---|
44 | ```bash
|
---|
45 | $ yarn test:watch
|
---|
46 | ```
|
---|
47 |
|
---|
48 | ## License
|
---|
49 |
|
---|
50 | MIT
|
---|
51 |
|
---|
52 | ## With thanks
|
---|
53 |
|
---|
54 | - [Tobias Koppers](https://github.com/sokra)
|
---|
55 | - [Glen Maddern](https://github.com/geelen)
|
---|
56 |
|
---|
57 | ---
|
---|
58 |
|
---|
59 | Mark Dalgleish, 2015.
|
---|
60 |
|
---|
61 | [ci-img]: https://img.shields.io/travis/css-modules/postcss-modules-local-by-default/master.svg?style=flat-square
|
---|
62 | [ci]: https://travis-ci.org/css-modules/postcss-modules-local-by-default
|
---|
63 | [npm-img]: https://img.shields.io/npm/v/postcss-modules-local-by-default.svg?style=flat-square
|
---|
64 | [npm]: https://www.npmjs.com/package/postcss-modules-local-by-default
|
---|
65 | [coveralls-img]: https://img.shields.io/coveralls/css-modules/postcss-modules-local-by-default/master.svg?style=flat-square
|
---|
66 | [coveralls]: https://coveralls.io/r/css-modules/postcss-modules-local-by-default?branch=master
|
---|
67 | [codecov-img]: https://img.shields.io/codecov/c/github/css-modules/postcss-modules-local-by-default/master.svg?style=flat-square
|
---|
68 | [codecov]: https://codecov.io/github/css-modules/postcss-modules-local-by-default?branch=master
|
---|