<h2 id="subject" class=""> The Subject </h2>
Each chip is a class on the element. Solid = currently on. Faint = not on.
RocketHour · Lesson 4.7 tutor demo
classList worksClick any button on the right. Watch four things happen at once. That cause-chain is the whole new idea in this lesson.
The subject
↑ the subject is hidden because it has the hidden class.
Remove it to bring it back.
<h2 id="subject" class=""> The Subject </h2>
Each chip is a class on the element. Solid = currently on. Faint = not on.
.red { color: #d62828; }
.big { font-size: 96px; }
A rule lights up only when its class is on the element.
Each button = one line of JavaScript, exactly as a student would write it.
A click runs a line of JS → that line changes which classes are on the element → whichever CSS rules match those classes apply → the page looks different.
The lesson's real code uses two-class layers (.theme as a base,
.red-text as an override) so that later rules win over earlier
ones. The mechanism is identical to what you see here.