Skip to content

Function: ampStaysAtScope()

ts
function ampStaysAtScope(branch): boolean;

Defined in: packages/core/src/parse.ts:76

Whether a single selector branch (no commas) keeps &/:scope meaning "the same scope root" one nesting level deeper — true for &, &.-mod, &::before, &:hover (chained onto the same compound, no combinator); false once a combinator introduces a new compound (& > .part, .part &, …), since a rule nested inside THAT one would have & refer to the new compound, not the original scope root.

Parameters

branch

string

Returns

boolean

Released under the MIT License