MCPcopy Create free account
hub / github.com/codemistic/Web-Development / changeTheme

Function changeTheme

Calculator/Script/script.js:80–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78}
79// Swaps the stylesheet in order to achieve dark mode.
80function changeTheme() {
81 let darkMode = document.getElementById("dark-mode");
82 let theme = document.getElementById("theme");
83 if (theme.getAttribute("href") === lightTheme) {
84 theme.href = darkTheme;
85 darkMode.innerHTML = "Light Mode 🌞";
86 } else {
87 theme.href = lightTheme;
88 darkMode.innerHTML = "Dark Mode 🌙";
89 }
90}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected