Skip to content

Commit

Permalink
minimal dark mode implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
elkcityhazard committed Jul 23, 2024
1 parent de20b6f commit 55720c0
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 359 deletions.
76 changes: 65 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<title>Underscore.js</title>
<style>
@import './static/css/theme-toggle.css';
body {
font-size: 14px;
line-height: 22px;
Expand Down Expand Up @@ -260,8 +259,72 @@
width: 100%;
}
}
@media screen and (prefers-color-scheme: light) {
img#logo {
filter: none;
}
}

@media screen and (prefers-color-scheme: dark) {
body {
background: #333 !important;
color: #c6c6c6;
}

div#sidebar {
background: #444;
border-right: 1px solid #666;
box-shadow: 0 0 20px #555;
-webkit-box-shadow: 0 0 20px #555;
-moz-box-shadow: 0 0 20px #555;
}

a.toc_title,
a.toc_title:visited {
color: #f4f4f4;
}

a.toc_title:hover {
text-decoration: underline;
}

.toc_section li a {
text-decoration: none;
color: #f4f4f4;
}

img#logo {
filter: brightness(0) invert(1);
}

div.warning {
color: #CC6060;
}

a,
a:visited {
color: #f4f4f4;
}

a:active,
a:hover {
color: #ffffff;
}

table .rule {
background: #777;
}

tt {
background: #444;
border: 1px solid #777;
}

pre {
border-left: 5px solid #aaa;
}
}
</style>
<script src="/static/js/themeToggle.js" defer></script>
</head>
<body>

Expand Down Expand Up @@ -4323,15 +4386,6 @@ <h2 id="changelog">Change Log</h2>

</div>

<form action="#" id="themeForm" data-name="toggleForm">
<div class="theme-control">
<label role="listbox" for="themeToggle" aria-label="theme">
<input role="option" type="checkbox" name="theme" id="themeToggle">
</label>
</div>
</form>


<!-- Include Underscore, so you can play with it in the console. -->
<script type="text/javascript" src="underscore-umd.js"></script>
<script type="text/javascript" src="docs/main.js"></script>
Expand Down
264 changes: 0 additions & 264 deletions static/css/theme-toggle.css

This file was deleted.

3 changes: 0 additions & 3 deletions static/images/moon-light.svg

This file was deleted.

3 changes: 0 additions & 3 deletions static/images/moon.svg

This file was deleted.

11 changes: 0 additions & 11 deletions static/images/sun-light.svg

This file was deleted.

11 changes: 0 additions & 11 deletions static/images/sun.svg

This file was deleted.

Loading

0 comments on commit 55720c0

Please sign in to comment.