CSS variables are great tools that can be used to manipulate the styling of a page using JavaScript. This lesson focuses on the syntax of variables, using two dashes before the variable name (i.e. —base) and using var() to access the value in other areas (i.e. background-color: var(—base);). For this lesson, the goal was to use sliders on the page to alter the spacing, blur, and border color of an image. Adding event listeners to the sliders and setting the style property with specific syntax is practiced in this lesson to give it the functionality. This lesson also introduces to dataset attributes in the HTML tags, which can be accessed using JavaScript (i.e. data-sizing=‘px’ can be accessed with JS using .dataset.sizing). For more info, please see my detailed blog.
Completed: Nov 24, 2020
Posted: Dec 5, 2020