diff --git a/themes/theme/static/darkmode-js.min.js b/themes/theme/static/darkmode-js.min.js deleted file mode 100644 index 0b505c0..0000000 --- a/themes/theme/static/darkmode-js.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("darkmode-js",[],t):"object"==typeof exports?exports["darkmode-js"]=t():e["darkmode-js"]=t()}("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};o.get||o.set?Object.defineProperty(t,n,o):t[n]=e[n]}return t.default=e,t}(n(1));var r=o.default;t.default=r,o.IS_BROWSER&&function(e){e.Darkmode=o.default}(window),e.exports=t.default},function(e,t,n){"use strict";function o(e,t){for(var n=0;n +{% endif %} + @@ -24,12 +33,22 @@ {% include 'fonts.css' %} - - + + +{% if PROD %} + +{% else %} +{% endif %}
@@ -54,12 +76,32 @@ telegram logo github logo

+

+ Light / Dark +

{% block content %} {% endblock %} + + + diff --git a/themes/theme/templates/style.css b/themes/theme/templates/style.css index dc39b2a..191e96d 100644 --- a/themes/theme/templates/style.css +++ b/themes/theme/templates/style.css @@ -5,20 +5,15 @@ html { body { text-rendering: optimizeLegibility; font: 1.2rem/1.0 Lato,sans-serif; - background-color: rgb(245, 245, 245); - background-color: white; } a { - color: #000000; text-decoration: none; outline: none; - border-bottom: 1px solid #000; } pre { font-size: 1rem; - background-color: #eee; padding: 1rem; } @@ -27,6 +22,12 @@ pre { margin: 2rem auto 0 auto; } +.theme-select { + font-size: 1rem; + margin-bottom: 0; + cursor: pointer; +} + .sidebar { margin-top: 2px; float: left; @@ -63,7 +64,7 @@ pre { .topbar .me { float: left; - height: 6rem; + height: 6.5rem; width: auto; } @@ -74,7 +75,6 @@ pre { } .topbar .contact-icons { - margin-top: 1.5rem; margin-left: 0.25rem; margin-bottom: 0; } @@ -89,9 +89,12 @@ pre { margin-right: 1rem; } +.topbar .theme-select { + margin-top: 0.5rem; +} + .toc { float: right; - background-color: #eee; padding: 0.75rem; padding-top: 0; margin-left: 0.75rem; @@ -107,7 +110,6 @@ pre { } .content p.metadata { - color: #555; font: 1rem/1.0 Apparatus SIL,serif; font-style: italic; } @@ -164,24 +166,118 @@ pre { } } -.darkmode-toggle { - z-index: 500; - background: black !important; + + +body { + background-color: #fff; + color: #000; } -.darkmode-toggle--white { - z-index: 500; - background: grey !important; +a { + color: #000; + border-bottom: 1px solid #000; } -.darkmode--activated .content img { +pre { + background-color: #eee; +} + +.toc { + background-color: #eee; +} + +.content p.metadata { + color: #555; +} + +body.dark { + background-color: #000; + color: #fff; +} + +body.dark a { + color: #fff; + border-bottom: 1px solid #fff; +} + +body.dark pre { + background-color: #222; +} + +body.dark .toc { + background-color: #222; +} + +body.dark .content p.metadata { + color: #aaa; +} + +body.dark .content img { filter: brightness(75%); } -.darkmode--activated video { - mix-blend-mode: difference; -} - -.darkmode--activated .contact-icons img { +body.dark .contact-icons img { filter: invert(1); } + +@media (prefers-color-scheme: dark) { + body.light { + background-color: #fff; + color: #000; + } + + body.light a { + color: #000; + border-bottom: 1px solid #000; + } + + body.light pre { + background-color: #eee; + } + + body.light .toc { + background-color: #eee; + } + + body.light .content p.metadata { + color: #555; + } + + body.light .contact-icons img { + filter: none; + } + + body.light .content img { + filter: none; + } + + body { + background-color: #000; + color: #fff; + } + + a { + color: #fff; + border-bottom: 1px solid #fff; + } + + pre { + background-color: #222; + } + + .toc { + background-color: #222; + } + + .content p.metadata { + color: #aaa; + } + + .content img { + filter: brightness(75%); + } + + .contact-icons img { + filter: invert(1); + } +}