lukeorth / poison

Professional Hugo theme for dev bloggers. Based on Mdo's classic Hyde theme.
https://poison.lukeorth.com
GNU General Public License v3.0
199 stars 98 forks source link

Changing the code background colors in config.toml has no effect #137

Closed HainLuud closed 10 months ago

HainLuud commented 11 months ago

If I change the code background colors for light and dark mode in config.toml to white for example

code_background_color = "#fff"       # default is #E5E5E5 
code_background_color_dark = "#fff"  # default is #393D47

then the code snippet background doesn't change. Inspecting the element in in both Firefox and Chrome shows that the background color is set to #272822 but searching for that value in the repo yields only the compiled html files in the publish directory. If I deselect it from being used in the browser then the two background values I set earlier take effect.

I have a fresh copy of poison and the latest hugo version.

I assume this is more a hugo problem, than a poison problem (though I'm new to hugo), but if this also happens for others then some workaround for those two parameters should be found.

HainLuud commented 11 months ago

Right now my workaround to enforce the background color parameters is to add

div.highlight pre {
    background-color: var(--code-background-color) !important;
}

to the assets/css/custom.css. It works for both states.

lukeorth commented 10 months ago

Thanks for letting me know about this, @HainLuud. I will try to get it fixed soon. :+1:

lukeorth commented 10 months ago

I fixed this issue and also expanded the code color options. You can now specify the code color / code background color for inline code and code blocks independently. See README for updates.