Skip to Content

nesting

Extends the built-in nesting with comma-separated selectors and the & parent selector.

Comma-Separated Selectors

nano.put('.foo', { '.bar, .baz': { color: 'red', }, });
.foo .bar, .foo .baz { color: red; }

Parent Selector &

nano.put('.foo', { color: 'red', '&:hover': { color: 'blue', }, '.global_class &': { color: 'green', }, });
.foo { color: red; } .foo:hover { color: blue; } .global_class .foo { color: green; }

Installation

import { addon as addonNesting } from 'nano-css/addon/nesting'; addonNesting(nano);
Last updated on