hugo-bearblog/layouts
Andrew Jorgensen b8c8871191
fix: code highlighting using Chroma (#20)
Chroma sets `color` (usually) and `background-color` directly on a
`<pre>` element under a `<div class="highlight">` but the theme was
interfering with those color settings from both the `code` and `pre
code` selectors. Since Chroma highlighting is under a `highlight` class
we can `unset` the colors that are set by the `code` selector elsewhere,
so that under a `<code>` element that's under a `<div
class="highlight">` it will just inherit from the `<pre>` above it where
Chroma sets all it's colors.

The `color: initial;` instead of `color: unset;` is needed because some
Chroma styles don't set a default text color, and if you use `unset`
instead that lets the browser use a lighter default text color when
using a dark color scheme.

That's a sort of long winded way of saying that I think I've fixed the
color interference problem in a way that won't mess with anything else
in the theme. I've tested this on a wide selection of Chroma styles,
with both light and dark color schemes and it seems to work correctly in
all cases. Which is to say that Chroma appears to have full control of
both `color` and `background-color` for code blocks that it's
highlighting.

Fixes #19
2021-04-13 17:24:30 +02:00
..
_default feat: enable optional custom date format 2021-04-12 17:18:41 +02:00
partials fix: code highlighting using Chroma (#20) 2021-04-13 17:24:30 +02:00
404.html chore: initial commit 2020-09-03 20:22:23 +02:00
index.html chore: initial commit 2020-09-03 20:22:23 +02:00
robots.txt chore: initial commit 2020-09-03 20:22:23 +02:00