Change a CSS Variable with Javascript

❗NEW❗ Image color palette picker

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.

Video on Scrimba

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

Change a CSS Variable with Javascript Video on Scrimba

Video on YouTube

If you prefer YouTube, I uploaded a screen recording of the Scrimba.

Change a CSS Variable with Javascript Video on YouTube

Follow my YouTube channel for more videos, as I will not create a blog post for every video.

Converting Colors

Converting Colors allows you to convert between 17 different color formats like RGB, CMYK, HSV, HSL, CIELab, Android, Decimal, and YUV.

Made with πŸ’˜, 🍺 and 🍫. If you have questions send me an email to [email protected]!

Privacy Policy  ·  Imprint

Menu

Support