Skip to main content
CSS Code Reorder Medium +20 XP

Custom Property Usage

Arrange the CSS custom property declaration and usage.

Click lines in the correct order

Available lines3 left

Your order

Click lines above to build your solution.

Show answer and explanation

Answer: :root { --brand: #229c6b; } .btn { background: var(--brand); } body { color: var(--brand); }

Custom properties should be declared in :root first so they cascade down to all elements.

Hint: :root declarations must come before they are used.

What this challenge tests

Code Reorder in CSS: custom-properties, variables.

Related challenges