Almost unreadable code highlighting in dark mode

Over on the Python Discourse, when using code blocks in dark mode, some of the highlighting makes the code unreadable.

For example:

class do(partial):
    def __rmatmul__(self, iterables):
        self.results = tuple(map(self, iterables))

Looks like this where tuple and map are barely visible:


(There’s no difference if I add python after the first triple backticks.)

Chrome’s devtools reports a contrast ratio of 1.2, where the minimum AA guidelines are 4.5 and 7.0:

[screenshot removed due to new user limits]

(The WAVE Web Accessibility Evaluation Tool wouldn’t run on the page.) [link removed due to new user limits]

This with default Discourse settings.

I know it’s possible to pick another theme, but please could you make it so the default syntax highlighting to work well in dark mode? This is also an accessibility issue.

Original discussion at:

Thanks! :relaxed:


We will get this styling sorted! thanks for letting us know :heart:


Thanks @hugovk for reporting this.

This PR fixes the highlight colour for dark theme.

This topic will close in a few days.


Thank you for the quick response and fix! :rocket:


This topic was automatically closed after 2 days. New replies are no longer allowed.