Loading exercise...

Exercise: Mix the Seed Packet Palette

This is the course’s first coding exercise, so here’s how coding exercises on RealJS work before you start on Bea’s palette.

How Coding Exercises Work

A coding exercise runs right here in your browser. Write your CSS in the editor above, then click Run Tests or press Ctrl+Enter (Cmd+Enter on macOS). Automated tests check your stylesheet and mark each test as passed or failed.

There’s no rendered page next to the editor. The tests load your CSS into a small copy of Bea’s catalogue page and read the values the browser works out, so their messages are your feedback. To see what a shade looks like, try it in your own test strip.

Run the tests early and often, even before you change anything. A failing test’s message tells you what it found and what it expected, so read it before you edit. Fix the first failing test, then run the tests again. A different failing test usually means you made progress!

Getting stuck is normal. The Hints tab nudges you one step at a time, so see whether one hint is enough to get you going. Thinking it through yourself is where most of the learning happens. You can also ask your mentor about the exercise and your code at any time.

Some exercises have tests marked Bonus. They’re extra challenges, and you’ve solved the exercise once the other tests pass.

For more room, click Full screen or press T while you’re not typing in the editor. When you’re done, open the Solution tab to compare your approach and read the notes.

Once your palette passes, the next lesson, Declare Tokens With light-dark(), gives each of Bea’s roles a second value for a dark theme.

Become a Member to join the conversation.