Cascade Layers — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the Cascade Layers lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Exercises(5)
- 1
Declare the layer order
easy10 minOrder base then theme, and let theme's blue win over base's red.
- 2
Let a later layer win
easy10 minTwo layers, base then theme; theme should make #title green.
- 3
Beat a layer from outside
easy10 minPut red in a layer and let an unlayered orange rule win.
- 4
Beat specificity with layer order
easy10 minA low-specificity theme layer should still beat an id rule in base.
- 5
Order three layers
medium10 minreset, base, then theme — theme's teal should win.
Find the bug(5)
- 1
Fix the reversed layer order
easy8 mintheme must be declared after base to win.
- 2
Fix the missing at-sign
easy8 minThe rule is @layer.
- 3
Fix the rule trapped in a layer
easy8 minAn unlayered rule is needed to beat the layer.
- 4
Fix the undeclared order
easy8 minWithout an order declaration the layers fall back to source order, and base comes last.
- 5
Fix the layer listed first
easy8 mintheme is listed before base, so it loses; it must come last.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace