Skip to content

Commit

Permalink
fix(theme): toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
KorigamiK committed Aug 6, 2023
1 parent 69c18b9 commit 59fe45f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions themes/ossn-theme/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
systemScheme = 'dark';
if (systemScheme === scheme) localStorage.removeItem("scheme");
else localStorage.setItem("scheme", scheme);

}

// Get the current scheme, and apply the opposite
Expand All @@ -117,8 +116,8 @@
}

function applyPreferredColorScheme(scheme) {
for (var s = 0; s < document.styleSheets.length; s++) {
if (document.styleSheets[s]?.href.startsWith("https://giscus.app")) continue;
for (var s = 0; s < document.styleSheets.length; ++s) {
if (document.styleSheets[s]?.href?.startsWith("https://giscus.app")) continue;
for (var i = 0; i < document.styleSheets[s].cssRules.length; i++) {
rule = document.styleSheets[s].cssRules[i];
if (rule && rule.media && rule.media.mediaText.includes("prefers-color-scheme")) {
Expand Down

0 comments on commit 59fe45f

Please sign in to comment.