Skip to content

LovesPictures/CSSvariables

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Project 3: CSS Variables (nice!)

Made with vanilla JavaScript

Judith Ricketts, Artist, Lecturer and Software engineer - Contact
Commit Date: 26th October 2021

Guide

Using CSS variables on an element from the :root. when you use a CSS variable you can then update that variable on any element and any selectors that are inside that element.

"CSS variables, more accurately known as CSS custom properties, are landing in Chrome 49. They can be useful for reducing repetition in CSS, and also for powerful runtime effects like theme switching and potentially extending/polyfilling future CSS features." CSS Variables: Why Should You Care? - see useful links

:root{}

e.g. filter:  var(--blur); on the element 

Approach

Update the CSS and create a function in Javascript using the classes to get the clock hands to rotate from a central pivot, depending in keeping with computer time (?).

Useful links