infotexture / dita-bootstrap

DITA Open Toolkit plug-in for HTML5 output with extensible Bootstrap style
https://infotexture.github.io/dita-bootstrap
Apache License 2.0
16 stars 10 forks source link

Codeblocks use dark Prism background in light mode #127

Closed infotexture closed 1 year ago

infotexture commented 1 year ago

The code block background in light mode seems much darker than the Bootstrap defaults.

Upon inspection, it looks like common-extended.css is using the darker --prism-background: #2d2d2d; as defined for [data-bs-theme="dark"] instead of the lighter --prism-background: #f5f2f0;.

This may be an issue in the upstream fox.jason.prismjs plug-in, just happened to notice it here.

See https://github.com/jason-fox/fox.jason.prismjs/blob/master/css/default-theme.css#L24.

@jason-fox No need to hold up the 5.3.3 release for this, but something to look into when we have the time.

jason-fox commented 1 year ago

This one isn't a bug, it is deliberate change in in the prism plugin to accommodate Bootswatch. The latest prismjs plugin detects if you are using bootstrap and will now default to bootstrap-theme.css and defer to your Bootstrap theme unless explicitly told otherwise. The reasoning behind this is that the Bootswatch themes deliberately mess around with the colours, and the prism plug-in should attempt to display code using the theme provided rather than using its own.

You can override this new behaviour with --prism.use.theme=default if you want to force the previous color scheme.

infotexture commented 1 year ago

👍 Got it, makes sense. Thanks for the explanation.