Quantcast
Channel: Can I affect CSS with JavaScript? - Stack Overflow
Browsing latest articles
Browse All 2 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 latest articles
Browse All 2 View Live