Skip to main content

Module style

Module style 

Source
Expand description

Structural extraction for CSS, SCSS, Sass and Less.

A stylesheet is a reference graph rather than a call graph: what matters is which selectors a file declares, because that is what an HTML class or id attribute resolves to, and which other stylesheets it pulls in.

Selectors are read from the token stream rather than by matching lines, which is what makes nesting work. In SCSS a rule written inside another rule is a real selector, and a & prefix concatenates it onto its parent - so .card { &__title { } } declares .card__title, a name that appears nowhere in the source as written.

Functionsยง

extract
Extracts structural facts from one stylesheet.