We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e7e7f12 commit 1118ea9Copy full SHA for 1118ea9
03 - CSS Variables/index-START.html
@@ -79,9 +79,14 @@ <h2>Update CSS Variables with <span class="hl">JS</span></h2>
79
const inputs = document.querySelectorAll('.controls input')
80
81
function handleUpdate() {
82
- console.log(this.value)
+ const suffix = this.dataset.sizing || ''
83
+ document.documentElement.style.setProperty(
84
+ `--${this.name}`,
85
+ this.value + suffix
86
+ )
87
}
88
inputs.forEach(input => input.addEventListener('change', handleUpdate))
89
+ inputs.forEach(input => input.addEventListener('mousemove', handleUpdate))
90
</script>
91
</body>
92
</html>
0 commit comments