Skip to content

Commit

Permalink
Use var(--color) as base color for code
Browse files Browse the repository at this point in the history
There are some Zola highlight themes and syntax definitions that don't
work very well, and as such, they sometimes fall back to the base text
color provided by the Zola theme. If the base text color is not neutral,
e.g. white or black, the code highlighting can look quite terrible, as
shown in getzola/zola#1423.

It would be nice if the `code` tag defaulted to `var(--color)` instead
of `var(--accent)` to avoid breaking several built-in Zola highlight
themes. With that said, if there's enough opposition to this change,
it's okay; I'm willing to just override the CSS in my own project to fix
the highlight themes.
  • Loading branch information
ebkalderon committed Nov 15, 2022
1 parent c9c3524 commit 0962056
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sass/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ pre {

code {
background: none !important;
color: var(--color);
margin: 0;
padding: 0;
font-size: inherit;
Expand Down

0 comments on commit 0962056

Please sign in to comment.