Transformation examples:
Selectors (mode local
, by default)::
.foo { ... } /* => */ :local(.foo) { ... } .foo .bar { ... } /* => */ :local(.foo) :local(.bar) { ... } /* Shorthand global selector */ :global .foo .bar { ... } /* => */ .foo .bar { ... } .foo :global .bar { ... } /* => */ :local(.foo) .bar { ... } /* Targeted global selector */ :global(.foo) .bar { ... } /* => */ .foo :local(.bar) { ... } .foo:global(.bar) { ... } /* => */ :local(.foo).bar { ... } .foo :global(.bar) .baz { ... } /* => */ :local(.foo) .bar :local(.baz) { ... } .foo:global(.bar) .baz { ... } /* => */ :local(.foo).bar :local(.baz) { ... }
Declarations (mode local
, by default):
.foo { animation-name: fadeInOut, global(moveLeft300px), local(bounce); } .bar { animation: rotate 1s, global(spin) 3s, local(fly) 6s; } /* => */ :local(.foo) { animation-name: :local(fadeInOut), moveLeft300px, :local(bounce); } :local(.bar) { animation: :local(rotate) 1s, spin 3s, :local(fly) 6s; }
In pure mode, all selectors must contain at least one local class or id selector
To ignore this rule for a specific selector, add the a /* cssmodules-pure-ignore */
comment in front of the selector:
/* cssmodules-pure-ignore */ :global(#modal-backdrop) { ...; }
or by adding a /* cssmodules-pure-no-check */
comment at the top of a file to disable this check for the whole file:
/* cssmodules-pure-no-check */ :global(#modal-backdrop) { ...; } :global(#my-id) { ...; }
MIT
Mark Dalgleish, 2015.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4