Skip to content

Use light theme for codeblocks

Marcel Amirault requested to merge use-light-codeblock-theme into main

What does this MR do and why?

This revives an old MR to revisit the idea of using a lighter style of codeblock. Previous MR used solarized light, this one is using the the default style from Pygments: https://pygments.org/styles/, which is claimed to meet WCAG 2.1 AA contrast minimum standard (for accessibility).

I think the choice of colors needs to be tweaked for optimal effect, but I think the defaults go a long way towards showing how it could be much easier on the eyes to have codeblocks that are not full black on a white background.

This would also bring it in line with the current coloring we have for inline code, like: inline code.

Screenshots, screen recordings, or links to review app

Some comparisons. Open the old and new versions in separate tabs, then you can switch back and forth between the tabs to see the difference clearly.

Click to see gif of change

dark-light

Runner page:

API page:

Omnibus page:

Ruby and Go codeblocks:

Related issues

Edited by Marcel Amirault

Merge request reports