Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Markdown tables unreadable in dark mode

#2857

When using dark mode, Markdown tables are unreadable in the preview as they use white text on a very light grey background.

Reported by Walter Dörwald · July 6th, 2021 @ 04:10 PM

State: new
Milestone: none
Assigned to: benny benny

Activity

  1. Walter Dörwald
    Walter Dörwald

    I've updated to the beta version (1.4 release 5937). Now the preview looks better, as it consistently uses light mode even if the OS is switched to dark mode.

    However the email recipient still sees white text on a white background for tables and code blocks. I guess it is hard or even impossible to generate HTML that honors the light/dark theme for the OS, since for the generated HTML all CSS rules must be moved into style attributes of the HTML elements. However a style attribute doesn't support media queries. So we might have to stick to one theme for the email. However the problem with the HTML as it is currently generated is the following. The HTML generated for code blocks looks like this:

    <pre style="margin-left: 15px; margin-right: 15px; padding: 5px; background-color: #F7F7F7; border-radius: 5px 5px 5px 5px; overflow-x: auto; max-width: 90vw;">
       <code style="margin: 0 0; border-radius: 3px; background-color: #F7F7F7; padding: 0px;">
          &lt;?ul4 la_table_headrow(app, content=None, id=None, cssclass=None, cssstyle=None, hide={/})?&gt;
          &lt;?whitespace strip?&gt;
    

    I.e. it specifies a background color, but no text color, so the email client chooses a text color that best matches the OS color theme, which in dark mode is white, which gives us white text on a nearly white background.

    Of course the background color for pre and code could simply be removed so that the email client can choose an appropriate background color too, but this will fall as soon as the code block uses syntax highlighting. So the better option might be to set the text color too.

    September 21st, 2023 @ 12:36 PM

  2. benny
    benny

    Does anyone still have this issue? I'm unable to reproduce it (the white text).

    August 27th, 2024 @ 03:51 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.