scrimba
Frontend Career Path
Welcome to the career path
Getting started
Let's Make a Cake!
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
Let's Make a Cake!
Expand for more info
index.js
run
preview
console
function setTheme(theme) {
let root = document.documentElement;
if (theme === 'light') {
root.style.setProperty('--bg-color', '#ECF2FF');
root.style.setProperty('--text-color', '#2B283A');
root.style.setProperty('--title-color', '#4A4E74');
} else if (theme === 'dark') {
root.style.setProperty('--bg-color', '#2B283A');
root.style.setProperty('--text-color', '#ECF2FF');
root.style.setProperty('--title-color', '#D5D4D8');
}
}

// 1. Try to change the theme to 'dark'
// 2. Run the code to see that it works
setTheme('light');
Console
/index.html
-4:54