-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML notes: font color incompatible with dark mode #9511
Comments
Possibly related: joplin/packages/renderer/HtmlToHtml.ts Lines 88 to 91 in 0f81b08
|
Well spotted! However, this means the current implementation lacks the corresponding change of the background to a light/white color IOW, ignore dark mode for the background rendering as well. That said, I'd argue that the original assessment in #3698 about the default webpage colors being white on black is hardly the norm nowadays. Modern websites come in all sorts of colors. Heck, I even have a browser addon running that renders all websites in my preferred dark theme That clearly shows that, technically, you don't have to (and probably shouldn't) make any assumptions. Keep in mind that HTML is just a markup language, like markdown. It should be content-agnostic. Thus I propose the following:
|
I think the issue is, in part, that clipped websites include CSS in addition to HTML. Because most browsers set the default text color to It is possible to override the defaults in some browsers, and this produces issues with many websites.This breaks As such, there are a few options:
|
Just the sake of discussion (and since I referenced it): Dark Reader Also, keep in mind that not all HTML notes represent webpage clippings. My use case is the Evernote (ENEX) import using HTML. Those notes do not contain any CSS or body-color attributes. Hence my proposal above, which covers notes with explicit CSS/styles/attributes (like web clippings) and those without (ENEX -> HTML imports). Thus from your options I'd vote for a combination of 2 and 4, which are pretty much in line with what I proposed:
|
I think the solution is simply to always have a light theme for the note viewer when notes are HTML. Maybe later we can do something smarter that for example processing all colours, but for now the only logical thing to do is to keep a white theme. |
Operating system
macOS
Joplin version
2.13.9
Desktop version info
macOS 13.6.3
Current behaviour
When using dark mode a HTML note (here: import from Evernote/ENEX) gets rendered with the default font color being black (the note itself doesn't specify any primary font color). This means normal texts get rendered black on dark. The only way to "fix" that is to switch the UI to light mode.
Expected behaviour
The default text color for rendering of HTML notes should be white when using dark mode. Explicit HTML font coloring should be retained, though.
The golden solution would be to go beyond that and let the user set/override the default text and background colors per notebook or even per note. But that would rather warrant a separate issue (as an enhancement request).
Logs
Thanks and keep up the great work!
The text was updated successfully, but these errors were encountered: