Changing CSS variables with JavaScript.
- CSS variables (actually CSS custom properties) can be used to assign values for later use in other properties.
filter
property applies various graphical effects like blur or contrast to an element.
- We used two new events.
change
which will be trigered when a value input changes andmousemove
which trigers when you move the mouse on the element. - data attributes can be accessed using the
HTMLelement.dataset
in javascript. - We can change the variables that we have defined on the
:root
element withdocument.documentElement.style.setProperty()