File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11<!DOCTYPE html>
22< html lang ="en ">
3+
34< head >
45 < meta charset ="UTF-8 ">
56 < title > Scoped CSS Variables and JS</ title >
67</ head >
8+
79< body >
8- < h2 > Update CSS Variables with < span class ='hl '> JS</ span > </ h2 >
10+ < h2 > Update CSS Variables with
11+ < span class ='hl '> JS</ span >
12+ </ h2 >
913
1014 < div class ="controls ">
1115 < label for ="spacing "> Spacing:</ label >
@@ -21,6 +25,10 @@ <h2>Update CSS Variables with <span class='hl'>JS</span></h2>
2125 < img src ="https://source.unsplash.com/7bwQXzbF6KE/800x500 ">
2226
2327 < style >
28+ /*
29+ misc styles, nothing to do with CSS variables
30+ */
31+
2432 : root {
2533 --base : # ffc600 ;
2634 --spacing : 10px ;
@@ -33,14 +41,10 @@ <h2>Update CSS Variables with <span class='hl'>JS</span></h2>
3341 filter : blur (var (--blur ));
3442 }
3543
36- .hl {
44+ span .hl {
3745 color : var (--base );
3846 }
3947
40- /*
41- misc styles, nothing to do with CSS variables
42- */
43-
4448 body {
4549 text-align : center;
4650 background : # 193549 ;
@@ -55,22 +59,22 @@ <h2>Update CSS Variables with <span class='hl'>JS</span></h2>
5559 }
5660
5761 input {
58- width : 100px ;
62+ width : 100px ;
5963 }
6064 </ style >
6165
6266 < script >
6367 const inputs = document . querySelectorAll ( '.controls input' ) ;
64-
6568 function handleUpdate ( ) {
6669 const suffix = this . dataset . sizing || '' ;
6770 document . documentElement . style . setProperty ( `--${ this . name } ` , this . value + suffix ) ;
71+ console . log ( ) ;
6872 }
6973
7074 inputs . forEach ( input => input . addEventListener ( 'change' , handleUpdate ) ) ;
7175 inputs . forEach ( input => input . addEventListener ( 'mousemove' , handleUpdate ) ) ;
7276 </ script >
7377
74-
7578</ body >
76- </ html >
79+
80+ </ html >
You can’t perform that action at this time.
0 commit comments