Quantcast
Channel: Can I affect CSS with JavaScript? - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by Bravo for Can I affect CSS with JavaScript?

document.documentElement.style.setProperty will do what you wantdocument.documentElement.style.setProperty('--colorText', 'black');document.documentElement.style.setProperty('--colorBack',...

View Article


Can I affect CSS with JavaScript?

I'm new to all this so sorry if it's a stupid question. Basically, I have my CSS colours set up as three :root functions and the JavaScript has everything done for a light mode/dark mode toggle but now...

View Article
Browsing all 2 articles
Browse latest View live




<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>