mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
Some pygment color schemes (like `bw`, which we use as default in the exampleSite) do not set a foreground color explicitly, which makes those themes look bad/illegible when using the dark mode of hugo-coder. Most such themes are light themes (it seems after a quick research), which explains this phenomenon. This commit adds a fix for such color schemes by setting the default foreground color to the one used in the light hugo-coder colorscheme. It is overridden by proper syntax highlighting schemes.
101 lines
1.4 KiB
SCSS
101 lines
1.4 KiB
SCSS
@mixin base_dark {
|
|
color: $fg-color-dark;
|
|
background-color: $bg-color-dark;
|
|
|
|
a {
|
|
color: $link-color-dark;
|
|
}
|
|
|
|
h1,
|
|
h2,
|
|
h3,
|
|
h4,
|
|
h5,
|
|
h6 {
|
|
color: $alt-fg-color-dark;
|
|
|
|
&:hover .heading-link {
|
|
visibility: visible;
|
|
}
|
|
|
|
.heading-link {
|
|
color: $link-color-dark;
|
|
font-weight: inherit;
|
|
text-decoration: none;
|
|
font-size: 80%;
|
|
visibility: hidden;
|
|
}
|
|
|
|
.title-link {
|
|
color: inherit;
|
|
font-weight: inherit;
|
|
text-decoration: none;
|
|
}
|
|
}
|
|
|
|
code {
|
|
background-color: $alt-bg-color-dark;
|
|
color: $fg-color-dark;
|
|
}
|
|
|
|
// fix color schemes which do not explicitly set fg-color
|
|
.highlight {
|
|
pre {
|
|
color: $fg-color;
|
|
}
|
|
}
|
|
|
|
pre {
|
|
code {
|
|
background-color: inherit;
|
|
color: inherit;
|
|
}
|
|
}
|
|
|
|
blockquote {
|
|
border-left: 2px solid $alt-bg-color-dark;
|
|
}
|
|
|
|
th,
|
|
td {
|
|
padding: 1.6rem;
|
|
}
|
|
|
|
table {
|
|
border-collapse: collapse;
|
|
}
|
|
|
|
table td,
|
|
table th {
|
|
border: 2px solid $alt-fg-color-dark;
|
|
}
|
|
|
|
table tr:first-child th {
|
|
border-top: 0;
|
|
}
|
|
|
|
table tr:last-child td {
|
|
border-bottom: 0;
|
|
}
|
|
|
|
table tr td:first-child,
|
|
table tr th:first-child {
|
|
border-left: 0;
|
|
}
|
|
|
|
table tr td:last-child,
|
|
table tr th:last-child {
|
|
border-right: 0;
|
|
}
|
|
}
|
|
|
|
body.colorscheme-dark {
|
|
@include base_dark();
|
|
}
|
|
|
|
body.colorscheme-auto {
|
|
@media (prefers-color-scheme: dark) {
|
|
@include base_dark();
|
|
}
|
|
}
|