Created
March 19, 2022 13:03
-
-
Save AhmetEnesKCC/2a2626b641601768da245da3f9bf6adb to your computer and use it in GitHub Desktop.
setTheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const setTheme = (theme) => { | |
const rootElement = document.querySelector("html"); | |
// Set <html daa-theme="theme"> to change children styles | |
rootElement.setQuery("data-theme", theme); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment