Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/7ma7X/HugoTeX.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelloRusk <hellorusk1998@gmail.com>2021-08-20 09:09:37 +0300
committerGitHub <noreply@github.com>2021-08-20 09:09:37 +0300
commit0faa415a5d30558495dce8bace945d1cd877cd33 (patch)
treefc650e0dd5d364214a18f3e9c130a7dea6f2d301
parent44e9ea17c3c4ca60f847b3e99a0f916eff5dcadf (diff)
parent60d50a90f2e4d1d3f909808dd32cc5b5541a4ef4 (diff)
Merge pull request #7 from AlexYzhov/master
add darkmode support
-rw-r--r--layouts/partials/head.html3
-rw-r--r--static/css/darkmode.css35
2 files changed, 37 insertions, 1 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index d562495..166571a 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -14,5 +14,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/latex.css" />
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/main.css" />
+<link rel="stylesheet" href="{{ .Site.BaseURL }}css/darkmode.css" />
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
-{{ hugo.Generator -}} \ No newline at end of file
+{{ hugo.Generator -}}
diff --git a/static/css/darkmode.css b/static/css/darkmode.css
new file mode 100644
index 0000000..fee713a
--- /dev/null
+++ b/static/css/darkmode.css
@@ -0,0 +1,35 @@
+@media (prefers-color-scheme: dark) {
+ html, body {
+ color: #dcdcdc;
+ background-color: #292929;
+ }
+
+ html *:not(input) {
+ color: #dcdcdc !important;
+ }
+
+ a[ping]:link,
+ :link:not(cite) {
+ color: #8db2e5 !important;
+ }
+
+ html a:visited {
+ color: #d248ea !important;
+ }
+
+ html cite,
+ html cite a:link,
+ html cite a:visited {
+ color: #92de92 !important;
+ }
+
+ /* inline styles */
+ [style*='background: #'], [style*='background:#'],
+ [style*='background: rgb'], [style*='background:rgb'],
+ [style*='background: var('], [style*='background:var('],
+ [style*='background-color: #'], [style*='background-color:#'],
+ [style*='background-color: rgb'], [style*='background-color:rgb'],
+ [style*='background-color: var('], [style*='background-color:var('] {
+ background-color: #292929 !important;
+ }
+}