scrimba
CSS variables
Changing variables with JavaScript - CSS Variables tutorial
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

Changing variables with JavaScript - CSS Variables tutorial
AboutCommentsNotes
Changing variables with JavaScript - CSS Variables tutorial
Expand for more info
index.css
run
preview
console
:root {
--red: #ff6f69;
--beige: #ffeead;
--yellow: #ffcc5c;
}

html, body {
background: var(--beige);
color: var(--red);
}

h1, p {
color: var(--red);
}

#navbar a {
color: var(--red);
}

.item {
background: var(--yellow);
color: var(--red);
}

button {
background: var(--red);
color: var(--yellow);
}

/*
--yellow: #ffe55b;
--red: #ff5564;

*/
Console
index.html
-3:48