loading...
Play Button Pause Button

Change a CSS Variable with Javascript

azettl profile image Andreas Originally published at scrimba.com ・1 min read

In this video I show you how to change a CSS Variable with Javascript, we will change the background to a fixed value and the text color will be selectable via a color input field.

The original video I recorded on Scrimba and you can find it here:
https://scrimba.com/c/czbPq3he

The nice thing there is, you can pause and change the code yourself to see more clearly how everything works!

Discussion

markdown guide