-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Finished dark theme * Fixing code for tests; I miss es6 * Reduced FOIT, but is still there * Added dark theme to Dynamax buttons * Removed duplicate classes * Added dark mode to Randoms calc * Removed unnecessary dark-theme class * Added Dark Mode for Honkalculator Has small styling issues that I couldn't figure out how to fix * Styled secret "Search" label
- Loading branch information
1 parent
b9deee2
commit 65e12da
Showing
5 changed files
with
223 additions
and
26 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
/* Dark mode styles */ | ||
|
||
body { | ||
color: white; | ||
background-color: black; | ||
} | ||
|
||
.btn { | ||
background-color: #161616; | ||
color: #B7B7B7; | ||
} | ||
|
||
.btn:hover { | ||
z-index: 10; | ||
border-color: #888888; | ||
background: black; | ||
} | ||
|
||
.visually-hidden:focus + .btn, | ||
.btn:hover { | ||
z-index: 10; | ||
border-color: #888888; | ||
background: black; | ||
} | ||
|
||
.visually-hidden:checked + .btn { | ||
font-weight: bold; | ||
color: white; | ||
background: #000042; | ||
} | ||
|
||
.visually-hidden:disabled + .btn { | ||
color: black; | ||
} | ||
|
||
fieldset { | ||
background-color: #222222; | ||
} | ||
|
||
select { | ||
background-color: black; | ||
color: white; | ||
} | ||
|
||
a.links-lighten { | ||
color: #7A9CFF; | ||
} | ||
|
||
a.links-lighten:hover { | ||
color: #C2D0FF; | ||
} | ||
|
||
a.links-lighten:visited { | ||
color: #BC8BEA; | ||
} | ||
|
||
a.links-lighten:visited:hover { | ||
color: #DACAF7; | ||
} | ||
|
||
input { | ||
background-color: black; | ||
color: white; | ||
} | ||
|
||
textarea { | ||
background-color: black; | ||
color: white; | ||
} | ||
|
||
.wrapper { | ||
background-color: black; | ||
color: white; | ||
} | ||
|
||
a.collapsible-link { | ||
color: white; | ||
} | ||
|
||
.bs-btn { | ||
background-color: #161616; | ||
color: #B7B7B7; | ||
} | ||
|
||
.bs-btn:hover { | ||
z-index: 10; | ||
border-color: #888888; | ||
background: black; | ||
} | ||
|
||
.popover-content { | ||
background-color: #161616; | ||
color: #B7B7B7; | ||
} | ||
|
||
.dataTables_info { | ||
color: #B7B7B7 !important; /* I know, don't use !important, but w/e */ | ||
} | ||
|
||
.search-label { | ||
color: #B7B7B7; | ||
} | ||
|
||
tr.odd, tr.even { | ||
background-color: rgb(0 0 0) !important; | ||
} | ||
|
||
|
||
td.sorting_1 { | ||
background-color: rgb(25 25 25) !important; | ||
} | ||
|
||
|
||
label:not(.btn) { | ||
color: white; | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Dark mode toggle | ||
* | ||
* In its current state, it will cause a minor FOIT. | ||
* Basically, the background behind the panels will | ||
* briefly flash white before turning dark. It's | ||
* better than before, but not perfect. | ||
*/ | ||
|
||
/* | ||
* localStorage will only store strings | ||
* This means that if it has the value 'false', | ||
* It will be truey and incorrectly cause the | ||
* dark theme to load. | ||
*/ | ||
var prefersDarkTheme = localStorage.getItem('darkTheme') === 'true'; | ||
|
||
var darkThemeButton = document.getElementById('dark-theme-toggle'); | ||
darkThemeButton.innerText = prefersDarkTheme ? 'Click for Light Theme' : 'Click for Dark Theme'; | ||
|
||
/* | ||
* Function that toggles light and dark mode | ||
* Doesn't use jQuery, probably could with some modification | ||
*/ | ||
function toggleTheme() { | ||
prefersDarkTheme = !prefersDarkTheme; | ||
|
||
var darkStyles = document.getElementById('dark-theme-styles'); | ||
darkStyles.disabled = !darkStyles.disabled; | ||
|
||
localStorage.setItem('darkTheme', prefersDarkTheme); | ||
darkThemeButton.innerText = prefersDarkTheme ? 'Click for Light Theme' : 'Click for Dark Theme'; | ||
} | ||
|
||
darkThemeButton.addEventListener('click', toggleTheme); |
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