Light mode begone

This commit is contained in:
Frankie B 2022-12-05 18:31:18 +00:00
parent 2485f3ff0e
commit 8edb1c6369
3 changed files with 0 additions and 110 deletions

View file

@ -1,4 +1,3 @@
<script src="/res/js/themeswap.js"></script>
<div class="header">
<nav>
<div>
@ -36,6 +35,5 @@
?>
</span>
<div style="float: right;"><a onclick="javascript:toggleTheme()">dark / light mode</a></div>
</div> <!-- pagetree -->
</div> <!-- header -->

View file

@ -1,82 +0,0 @@
/*
This stylesheet contains only colors which are
different depending on theme. All other styles have
been moved to global.css and imported below.
*/
@import url('global.css');
/*html {
color-scheme: dark;
}
div.project pre {
border: 1px solid #666666
}*/
body {
color: #000;
background-color: #fff;
}
h1 {
color: #333;
font-size: 150%
}
h2 {
color: #333;
font-size: 130%
}
h3 {
color: #333;
}
div.preview pre, div.project pre {
background-color: #333;
color: #fff;
}
a {
color: #009;
}
.header {
color: #333;
border-bottom: 1px solid #cccccc;
}
.header .pagetree {
color: #333;
border-top: 1px solid #cccccc
}
.header .pagetree .title {
color: #333
}
table td {
border: 1px solid black
}
table.skami {
border-color: #eeeeee
}
table.skami .semiused {
color: #111;
background-color: #eee
}
table.skami .unused {
color: #222;
background-color: #ddd
}
.toplinks {
border-bottom: 1px solid #cccccc
}
.deprecated {
color: #aa0000;
border-bottom: 2px dashed #aa0000
}

View file

@ -1,26 +0,0 @@
function addStyleSheet(name, id) {
var path = '/res/css/' + name + '.css';
var old = document.getElementById(id);
if (old && (old.href != path)) {
old.href = path;
}
}
var otherTheme = {
'dark': 'light',
'light': 'dark',
};
var currentTheme = localStorage.getItem('theme');
if (!otherTheme.hasOwnProperty(currentTheme)) {
currentTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
}
addStyleSheet(currentTheme, 'theme');
function toggleTheme() {
currentTheme = otherTheme[currentTheme] || 'light';
localStorage.setItem('theme', currentTheme);
addStyleSheet(currentTheme, 'theme');
}