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

github.com/janraasch/hugo-bearblog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Jorgensen <andrew@jorgensenfamily.us>2021-08-13 09:42:04 +0300
committerGitHub <noreply@github.com>2021-08-13 09:42:04 +0300
commit2fa45b92a24e76a610f86f1e039225be5d8cb695 (patch)
treeee0bb542381238551b6dc98aef7305ebbc965719
parent78c5241a8ef4f90d9944eed0c7429504d4ca6c15 (diff)
Fix a remaining issue with b8c8871 (#20) (#25)
It turns out my original proposal for #20 was correct, but not for the reasons I thought. We need to set both `background-color` and `color` to `initial` on `div.highlight pre` because that's where Chroma sets those colors (including the default `color` if configured). Setting to `initial` there makes it so that if the selected style *doesn't* configure a default color, we'll use the `initial` color, which is going to be the right choice because the reason style author left that unset because they didn't consider dark color schemes messing with their style. Then we `unset` the colors on `div.highlight code` because otherwise the `code` colors from the theme will override the colors that would otherwise be inherited from Chroma's `<pre>` element. Stricly speaking I can't say that setting `background-color` to `initial` is required, because I haven't found a Chroma style that *doesn't* set a `background-color`, but I figure it's possible (at least for a light theme) and it makes sense to fix it just in case, and causes no harm otherwise.
-rw-r--r--layouts/partials/style.html7
1 files changed, 6 insertions, 1 deletions
diff --git a/layouts/partials/style.html b/layouts/partials/style.html
index 173aec9..9be0c35 100644
--- a/layouts/partials/style.html
+++ b/layouts/partials/style.html
@@ -75,9 +75,14 @@
font-size: 14px;
}
+ div.highlight pre {
+ background-color: initial;
+ color: initial;
+ }
+
div.highlight code {
background-color: unset;
- color: initial;
+ color: unset;
}
blockquote {