Colour, Typography and Responsive Charts
Pick colour scales that tell the truth, test them for colour-blind readers and contrast, set type that survives scaling, support dark mode, and redraw charts when their box resizes.
Until now every colour in the dashboard was typed into the chart code. That works on one monitor in one room. This phase asks what happens on the wall screen, in dark mode, on a phone, and for the one rider in twelve who sees colours differently.
You learn the three kinds of colour scale and which job each does, how colour-blind readers see a palette (and how to test it with code), the contrast ratios the web accessibility rules ask for, how to size and place text and annotations, how to move every colour into CSS tokens for light and dark, and how to redraw a chart when its box changes width.
At the end the dashboard has one theme.css, a colour-blind-safe palette, titles that state the finding, a theme button, and charts that choose their ticks and labels by width.
Phase 10 · the story
Priya, operations lead
“The dashboard looks fine on Arjun's monitor, but on the wall screen I can't read it, in dark mode the lines vanish, and one of our riders says two of the districts look identical.”
Lumen Bikes put the dashboard on a big screen in the operations room. From the back of the room the small grey labels vanish. At night Priya switches her laptop to dark mode and the charts glow white on white: the cards turned dark, but the bars kept their colours and the text kept its dark ink.
Then a rider who is red-green colour blind writes in. On the stacked chart, he says, two of the six districts look like the same muddy yellow. Arjun checks and finds he is right: the palette was picked by eye, and nobody tested it.
In this phase the team stops choosing colours by eye. They pick scales for each job, test the palette with code, move every colour into one theme file, and make the charts choose their ticks by width. By the end of the phase the same dashboard reads on a phone, on the wall screen, in dark mode and for riders who see colour differently.
In this phase
You will learn
- Choose a sequential, diverging or categorical colour scale for the job, and say why a rainbow is the wrong one for order
- Test a palette against colour-blindness simulation and the WCAG contrast thresholds, with code you run
- Move every chart colour into CSS tokens, so light and dark mode are one switch
- Redraw a chart when its box changes width, with fewer ticks and shorter labels on a phone
You write code in
In your Vite project lumen-dashboard/ (run npm run dev), and in the editor on this page
Files you touch
- src/styles/theme.css
- src/styles/charts.css
- src/utils/resize.js
- src/charts/*.js
- src/main.js
- index.html
Practise this phase
Hands-on exercises: write the code, see your page live, and press Check to have it tested automatically.