Skip to content

Commit 38d6983

Browse files
committed
interesting, i tried to apply the inline style to controls div instead of the html element and it doesnt work, you can see the values changing like it does on the html elmeent but it doesnt change the rendering at all
1 parent 8826655 commit 38d6983

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

03 - CSS Variables/index-START.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ <h2>Update CSS Variables with <span class='hl'>JS</span></h2>
6262

6363

6464
<script>
65+
const controls = document.querySelector('.controls')
6566
const inputs = document.querySelectorAll('.controls input');
6667
console.log('inputs: ', inputs);
6768
function handleUpdate () {
@@ -70,6 +71,7 @@ <h2>Update CSS Variables with <span class='hl'>JS</span></h2>
7071
// 'undefined'
7172
const suffix = this.dataset.sizing || '';
7273
document.documentElement.style.setProperty(`--${this.name}`, this.value + suffix);
74+
controls.style.setProperty(`--${this.name}`, this.value + suffix);
7375
// console.log('suffix: ', suffix);
7476
// console.log('name: ', this.name);
7577
};

0 commit comments

Comments
 (0)