summaryrefslogtreecommitdiff
path: root/static/style.css
diff options
context:
space:
mode:
authornanxiaobei <nanxiaobei@gmail.com>2019-10-15 01:31:07 +0800
committernanxiaobei <nanxiaobei@gmail.com>2019-10-15 01:31:07 +0800
commitba297661ff44f2e60c96f0640a4c4d23760826df (patch)
tree4d61637a5b3fb97e20b4b47065d63a39ff998802 /static/style.css
parent072d2a8c22bc45391a27826b95ee3b811422c3e9 (diff)
Add dark mode
Diffstat (limited to 'static/style.css')
-rw-r--r--static/style.css44
1 files changed, 23 insertions, 21 deletions
diff --git a/static/style.css b/static/style.css
index f61700b..012be40 100644
--- a/static/style.css
+++ b/static/style.css
@@ -3,10 +3,10 @@
* A simple, clean, flexible Hugo theme
* https://github.com/nanxiaobei/hugo-paper
* Designed by MR.LEE (https://mrlee.me/)
- * Updated in 2019.9.15
+ * Updated in 2019.10.15
*/
-/* Variables
+/* Theme
-------------------------------------------------- */
:root {
--gap: 24px;
@@ -17,6 +17,7 @@
--footer-height: 60px;
--radius: 8px;
+ --theme: #fff;
--primary: rgba(0, 0, 0, 0.88);
--secondary: rgba(0, 0, 0, 0.56);
--tertiary: rgba(0, 0, 0, 0.16);
@@ -25,6 +26,22 @@
--code-bg: #f5f5f5;
--border: #eee;
}
+.dark {
+ --theme: #3c3c3c;
+ --primary: rgba(255, 255, 255, 0.88);
+ --secondary: rgba(255, 255, 255, 0.56);
+ --tertiary: rgba(255, 255, 255, 0.16);
+
+ --hljs-bg: #2a2a2a;
+ --code-bg: #4f4f4f;
+ --border: #5f5f5f;
+}
+.list {
+ background: linear-gradient(135deg, #e2e2e2, #f8f8f8, #ddd);
+}
+.dark.list {
+ background: linear-gradient(135deg, #1c1c1c, #2a2a2a, #000);
+}
/* Reset
-------------------------------------------------- */
*,
@@ -43,6 +60,7 @@ body {
font-size: 18px;
line-height: 1.8;
word-break: break-word;
+ background: var(--theme);
}
article,
aside,
@@ -112,7 +130,7 @@ textarea {
}
input:-webkit-autofill,
textarea:-webkit-autofill {
- box-shadow: 0 0 0 50px #fff inset;
+ box-shadow: 0 0 0 50px var(--theme) inset;
}
img {
display: block;
@@ -153,22 +171,6 @@ img {
.menu a {
font-size: 16px;
}
-/* Body
--------------------------------------------------- */
-.list {
- position: relative;
- background: linear-gradient(135deg, #e2e2e2, #f8f8f8, #ddd);
-}
-.list-bg {
- position: absolute;
- z-index: -1;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- background: rgba(0, 0, 0, 0.24);
- opacity: 0;
-}
/* Main
-------------------------------------------------- */
.main {
@@ -189,7 +191,7 @@ img {
display: flex;
}
.pagination a {
- color: #fff;
+ color: var(--theme);
font-size: 13px;
line-height: 36px;
background: var(--primary);
@@ -236,7 +238,7 @@ img {
position: relative;
margin-bottom: var(--gap);
padding: var(--gap);
- background: #fff;
+ background: var(--theme);
border-radius: var(--radius);
transition: transform 0.1s;
}