module

Hwaro::Assets::Sass::Extend

Instance methods

extend_selector(selector : String, target : String, extenders : Array(String)) : Array(Tuple(String, Int32)) | Nil

nil when selector does not contain target as a complete simple selector; otherwise every extension of selector by extenders (possibly empty when no extender unifies — the target still counts as found). Each result pairs the added selector with the index of the extender that produced it (-1 for a pseudo-argument extension, which rewrites the extended selector itself) so the caller can carry the extender's line-break flag.

Source
keyframes_name?(name : String) : Bool
Source
parse_items(selector : String) : Array(Item) | Nil

Parses a complex selector into compounds and combinators; nil when the text is too exotic to model (unbalanced quotes/spans).

Source
placeholder?(selector : String) : Bool

True when the selector references a %placeholder outside quotes and attribute brackets — such selectors never reach the output (dart-sass emits nothing for un-extended placeholders).

Source
scrub_placeholders(nodes : Array(Css::Node)) : Nil

Removes placeholder selectors from every rule (recursively, skipping @keyframes bodies) and drops rules with none left.

Source
unify_compound(ext : Array(String), rest : Array(String)) : Array(String) | Nil

Merges the extender's final compound with what remains of the extended compound: element selector first, then the other simple selectors, pseudo-classes/-elements last. nil when the two need different element selectors (div vs span can't both match).

Source

Nested types