Commit Graph

9 Commits

Author SHA1 Message Date
afc4681a01
hugo-bearblog : add _index.md for blog and add random color gimmick 2024-03-09 17:59:51 +07:00
e437c66e80
hugo-bear-blog : support 'lastmod' and add darkmode toggle 2024-03-09 13:27:57 +07:00
Andrew Jorgensen
fc2635f25d
Use overflow-x: auto to avoid spilling long lines (#49) 2022-09-15 03:26:34 +02:00
Andrew Jorgensen
2fa45b92a2
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.
2021-08-13 08:42:04 +02:00
Jan Raasch
78c5241a8e Revert "Do not touch div.highlight styles"
This reverts commit d3a86c7c6d.
2021-08-13 08:40:13 +02:00
Jan Raasch
d3a86c7c6d Do not touch div.highlight styles
Closes #25
2021-08-09 18:56:14 +02:00
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
Jan Raasch
0c3efa646d feat: add dark color scheme for dark mode
see https://github.com/HermanMartinus/bearblog/pull/51
2020-10-01 15:33:23 +02:00
Jan Raasch
5880538157 chore: initial commit 2020-09-03 20:22:23 +02:00