Remove darkmode selector

columns
Tanner Collin 3 years ago
parent 5bcad7eb77
commit b5b9e68df0
  1. 6
      publishconf.py
  2. 3
      themes/theme/templates/article.html
  3. 51
      themes/theme/templates/base.html
  4. 3
      themes/theme/templates/index.html
  5. 79
      themes/theme/templates/style.css

@ -54,10 +54,10 @@ AUTHORS_SAVE_AS = ''
CATEGORIES_SAVE_AS = '' CATEGORIES_SAVE_AS = ''
TAGS_SAVE_AS = '' TAGS_SAVE_AS = ''
INDEX_SAVE_AS = 'index.php' INDEX_SAVE_AS = 'index.html'
ARTICLE_URL = '{slug}/' ARTICLE_URL = '{slug}/'
ARTICLE_SAVE_AS = '{slug}/index.php' ARTICLE_SAVE_AS = '{slug}/index.html'
PAGE_URL = '{slug}/' PAGE_URL = '{slug}/'
PAGE_SAVE_AS = '{slug}/index.php' PAGE_SAVE_AS = '{slug}/index.html'
PROD = True PROD = True

@ -31,9 +31,6 @@
<a href="https://t.me/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="telegram" src="/theme/telegram.svg" width="20" height="20" /></a> <a href="https://t.me/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="telegram" src="/theme/telegram.svg" width="20" height="20" /></a>
<a href="https://github.com/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="github" src="/theme/github.svg" width="20" height="20" /></a> <a href="https://github.com/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="github" src="/theme/github.svg" width="20" height="20" /></a>
</p> </p>
<p class='theme-select'>
<a onClick="setTheme('light')">Light</a> / <a onClick="setTheme('dark')">Dark</a>
</p>
{% endblock %} {% endblock %}
{% block content %} {% block content %}

@ -36,53 +36,22 @@
</style> </style>
<script defer src="/theme/instant-page.js"></script> <script defer src="/theme/instant-page.js"></script>
<noscript>
<style type="text/css">
.theme-select {
display: none !important;
}
</style>
</noscript>
</head> </head>
{% if PROD %} <body>
<body class="<?php echo $themeClass; ?>"> <div class="container">
{% else %} <div class="bar">
<body> {% block info %}
{% endif %} {% endblock %}
</div>
<div class="container"> {% block content %}
<div class="bar">
{% block info %}
{% endblock %} {% endblock %}
</div> </div>
{% block content %} <p class="copyright">
{% endblock %} © 2012–2021 Tanner Collin
</div> </p>
<p class="copyright">
© 2012–2021 Tanner Collin
</p>
<script>
function setTheme(theme) {
console.log('Setting theme to', theme);
if (theme == 'dark') {
document.body.classList.add('dark');
document.body.classList.remove('light');
} else if (theme == 'light') {
document.body.classList.add('light');
document.body.classList.remove('dark');
}
document.cookie = 'theme=' + theme + '; Max-Age=31536000; Path=/; SameSite=Lax';
}
</script>
</body> </body>
</html> </html>

@ -16,9 +16,6 @@
<a href="https://t.me/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="telegram" src="/theme/telegram.svg" width="20" height="20" /></a> <a href="https://t.me/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="telegram" src="/theme/telegram.svg" width="20" height="20" /></a>
<a href="https://github.com/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="github" src="/theme/github.svg" width="20" height="20" /></a> <a href="https://github.com/tannercollin" target="_blank" rel="noreferrer noopener"><img alt="github" src="/theme/github.svg" width="20" height="20" /></a>
</p> </p>
<p class='theme-select'>
<a onClick="setTheme('light')">Light</a> / <a onClick="setTheme('dark')">Dark</a>
</p>
</div> </div>
{% endblock %} {% endblock %}

@ -46,12 +46,6 @@ pre {
text-align: center; text-align: center;
} }
.theme-select {
font-size: 1rem;
margin-bottom: 0;
cursor: pointer;
}
.toc { .toc {
float: right; float: right;
padding: 0.75rem; padding: 0.75rem;
@ -184,14 +178,9 @@ pre {
height: 1.5rem; height: 1.5rem;
margin-right: 1rem; margin-right: 1rem;
} }
.bar .theme-select {
margin-top: 0.5rem;
}
} }
body { body {
background-color: #eee; background-color: #eee;
color: #000; color: #000;
@ -218,75 +207,7 @@ pre {
color: #555; color: #555;
} }
body.dark {
background-color: #000;
color: #eee;
}
body.dark a {
color: #eee;
border-bottom: 1px solid #eee;
}
body.dark pre {
background-color: #222;
}
body.dark :not(pre)>code {
background-color: #222;
}
body.dark .toc {
background-color: #222;
}
body.dark .content p.metadata {
color: #aaa;
}
body.dark .content img {
filter: brightness(75%);
}
body.dark .contact-icons img {
filter: invert(1);
}
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
body.light {
background-color: #eee;
color: #000;
}
body.light a {
color: #000;
border-bottom: 1px solid #000;
}
body.light pre {
background-color: #ddd;
}
body.light :not(pre)>code {
background-color: #ddd;
}
body.light .toc {
background-color: #ddd;
}
body.light .content p.metadata {
color: #555;
}
body.light .contact-icons img {
filter: none;
}
body.light .content img {
filter: none;
}
body { body {
background-color: #000; background-color: #000;
color: #eee; color: #eee;

Loading…
Cancel
Save