Added dark mode
This commit is contained in:
+28
-9
@@ -40,9 +40,28 @@
|
|||||||
url('../fonts/LM-bold-italic.ttf') format('truetype');
|
url('../fonts/LM-bold-italic.ttf') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--main-bg-color: hsl(210, 20%, 98%);
|
||||||
|
--main-text-color: hsl(0, 5%, 10%);
|
||||||
|
--main-link-color: hsl(0, 100%, 35%);
|
||||||
|
--table-border-color: hsl(0, 0%, 85%);
|
||||||
|
--table-head-border-color: hsl(0, 0%, 70%);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
:root {
|
||||||
|
--main-bg-color: hsl(0, 5%, 10%);
|
||||||
|
--main-text-color: hsl(210, 20%, 98%);
|
||||||
|
--main-link-color: hsl(0, 100%, 65%);
|
||||||
|
--table-border-color: hsl(0, 0%, 15%);
|
||||||
|
--table-head-border-color: hsl(0, 0%, 30%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
*, *::before, *::after {
|
*, *::before, *::after {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
body, h1, h2, h3, h4, p, ul[class], ol[class], li, figure, figcaption, dl, dd {
|
body, h1, h2, h3, h4, p, ul[class], ol[class], li, figure, figcaption, dl, dd {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
@@ -67,8 +86,8 @@ body {
|
|||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 2rem 1.25rem;
|
padding: 2rem 1.25rem;
|
||||||
color: hsl(0, 5%, 10%);
|
color: var(--main-text-color);
|
||||||
background-color: hsl(210, 20%, 98%);
|
background-color: var(--main-bg-color);
|
||||||
text-rendering: optimizeLegibility;
|
text-rendering: optimizeLegibility;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +102,7 @@ a:not([class]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
a, a:visited {
|
a, a:visited {
|
||||||
color: #a00;
|
color: var(--main-link-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
a:focus {
|
a:focus {
|
||||||
@@ -224,7 +243,7 @@ footer.post-info {
|
|||||||
.entry-content a:after {
|
.entry-content a:after {
|
||||||
content: '[' counter(entrylinks) ']';
|
content: '[' counter(entrylinks) ']';
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
color: #a00;
|
color: var(--main-link-color);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
@@ -296,7 +315,7 @@ footer.post-info {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.entry-content td {
|
.entry-content td {
|
||||||
border-bottom: 1px solid hsl(0, 0%, 85%);
|
border-bottom: 1px solid var(--table-border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry-content th:not([align]), td:not([align]) {
|
.entry-content th:not([align]), td:not([align]) {
|
||||||
@@ -305,23 +324,23 @@ footer.post-info {
|
|||||||
|
|
||||||
.entry-content th:empty,
|
.entry-content th:empty,
|
||||||
.entry-content td:empty {
|
.entry-content td:empty {
|
||||||
border-left: 1px solid hsl(0, 0%, 85%);
|
border-left: 1px solid var(--table-border-color);
|
||||||
width: 0;
|
width: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry-content th:empty~th:empty,
|
.entry-content th:empty~th:empty,
|
||||||
.entry-content td:empty~td:empty {
|
.entry-content td:empty~td:empty {
|
||||||
border-left: 1px double hsl(0, 0%, 85%);
|
border-left: 1px double var(--table-border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.entry-content thead th {
|
.entry-content thead th {
|
||||||
border-bottom: 2px solid hsl(0, 0%, 70%);
|
border-bottom: 2px solid var(--table-head-border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry-content tfoot th {
|
.entry-content tfoot th {
|
||||||
border-top: 2px solid hsl(0, 0%, 70%);
|
border-top: 2px solid var(--table-head-border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user