source: frontend/node_modules/postcss-modules-local-by-default/README.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 2.9 KB
Line 
1[![Build Status][ci-img]][ci] [![codecov][codecov-img]][codecov] [![npm][npm-img]][npm]
2
3# CSS Modules: Local by Default
4
5Transformation examples:
6
7Selectors (mode `local`, by default)::
8
9<!-- prettier-ignore-start -->
10```css
11.foo { ... } /* => */ :local(.foo) { ... }
12
13.foo .bar { ... } /* => */ :local(.foo) :local(.bar) { ... }
14
15/* Shorthand global selector */
16
17:global .foo .bar { ... } /* => */ .foo .bar { ... }
18
19.foo :global .bar { ... } /* => */ :local(.foo) .bar { ... }
20
21/* Targeted global selector */
22
23:global(.foo) .bar { ... } /* => */ .foo :local(.bar) { ... }
24
25.foo:global(.bar) { ... } /* => */ :local(.foo).bar { ... }
26
27.foo :global(.bar) .baz { ... } /* => */ :local(.foo) .bar :local(.baz) { ... }
28
29.foo:global(.bar) .baz { ... } /* => */ :local(.foo).bar :local(.baz) { ... }
30```
31<!-- prettier-ignore-end -->
32
33Declarations (mode `local`, by default):
34
35<!-- prettier-ignore-start -->
36```css
37.foo {
38 animation-name: fadeInOut, global(moveLeft300px), local(bounce);
39}
40
41.bar {
42 animation: rotate 1s, global(spin) 3s, local(fly) 6s;
43}
44
45/* => */
46
47:local(.foo) {
48 animation-name: :local(fadeInOut), moveLeft300px, :local(bounce);
49}
50
51:local(.bar) {
52 animation: :local(rotate) 1s, spin 3s, :local(fly) 6s;
53}
54```
55<!-- prettier-ignore-end -->
56
57## Pure Mode
58
59In pure mode, all selectors must contain at least one local class or id
60selector
61
62To ignore this rule for a specific selector, add the a `/* cssmodules-pure-ignore */` comment in front
63of the selector:
64
65```css
66/* cssmodules-pure-ignore */
67:global(#modal-backdrop) {
68 ...;
69}
70```
71
72or by adding a `/* cssmodules-pure-no-check */` comment at the top of a file to disable this check for the whole file:
73
74```css
75/* cssmodules-pure-no-check */
76
77:global(#modal-backdrop) {
78 ...;
79}
80
81:global(#my-id) {
82 ...;
83}
84```
85
86## Building
87
88```bash
89$ npm install
90$ npm test
91```
92
93- Build: [![Build Status][ci-img]][ci]
94- Lines: [![coveralls][coveralls-img]][coveralls]
95- Statements: [![codecov][codecov-img]][codecov]
96
97## Development
98
99```bash
100$ yarn test:watch
101```
102
103## License
104
105MIT
106
107## With thanks
108
109- [Tobias Koppers](https://github.com/sokra)
110- [Glen Maddern](https://github.com/geelen)
111
112---
113
114Mark Dalgleish, 2015.
115
116[ci-img]: https://github.com/css-modules/postcss-modules-local-by-default/actions/workflows/nodejs.yml/badge.svg
117[ci]: https://github.com/css-modules/postcss-modules-local-by-default/actions/workflows/nodejs.yml
118[npm-img]: https://img.shields.io/npm/v/postcss-modules-local-by-default.svg?style=flat-square
119[npm]: https://www.npmjs.com/package/postcss-modules-local-by-default
120[coveralls-img]: https://img.shields.io/coveralls/css-modules/postcss-modules-local-by-default/master.svg?style=flat-square
121[coveralls]: https://coveralls.io/r/css-modules/postcss-modules-local-by-default?branch=master
122[codecov-img]: https://img.shields.io/codecov/c/github/css-modules/postcss-modules-local-by-default/master.svg?style=flat-square
123[codecov]: https://codecov.io/github/css-modules/postcss-modules-local-by-default?branch=master
Note: See TracBrowser for help on using the repository browser.