Skip to content
Astera Technology

Override one inherited token locally

Trace a green token into a purple subtree while outside siblings stay green.

Paragraph colors in source order are green, purple and green.

Download complete case notes and answer keys ↓

Inspect the working example

The lesson root defines --ink green. The alternate subtree overrides --ink purple. All three paragraphs use color:var(--ink).

Inputs and native observations
CaseInput or inspectionResult and meaning
First paragraphResolve inherited --inkGreen from lesson
Nested paragraphResolve nearest --inkPurple from alternate
Last siblingResolve its ancestor pathGreen; alternate is not its ancestor
Download editable CSV ↓

Follow the browser mechanism

Unregistered custom properties inherit by default. Each element resolves the property on its own ancestor path, so a local override does not change siblings outside that subtree. The name is a CSS token, not a saved application setting.

Changing the ancestor affects all non-overridden descendants

The alternative puts purple on the lesson root and removes the local override.

Counterexample source; inspect separately
<style>body{margin:8px}</style>
<style>.lesson{--ink:rgb(80,0,100)}p{color:var(--ink)}</style><section class="lesson"><p>Default note</p><section><p>Alternate note</p></section><p>Default again</p></section>

All three paragraphs become purple. That does not achieve an isolated local color change.

Try the repair

Can the last paragraph inherit from an earlier sibling’s alternate subtree?

Show the worked answer

No. Inheritance follows its ancestors, not earlier siblings. It receives the lesson root’s green token.

  • Record the three computed colors and token ancestor paths.
  • Do not equate CSS inheritance with saved business-setting inheritance.

Original example files

Related resources