You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most websites, in my experience out of ones I browse, assume light mode by default. However, terminals are likely to be in dark mode. Following the recent trend to have websites support both light and dark modes through the prefers-color-scheme media query, I think it makes sense for elinks to support this, and have the configurable, eg document.css.prefers_color_scheme set to "dark" by default.
This allows websites that set light background colors by default, but dark background colors for dark mode, to be shown in dark mode in elinks.
Before opening this issue, I digged through the code base and played around with the CSS parser. It looks like elinks currently only support Media types (@media type1,type2,type3... {}/@media type1 {}).
Media features does not seem to be supported, but it was relatively easy to add support for only (prefers-color-scheme: <light|dark>) specifically, for now, whilst keeping the existing support (eg @media tty { ... }).
I'm not super confident my patch is robust, but it works fairly well during my testing. I'm interested in opening an PR for it.
The text was updated successfully, but these errors were encountered:
Most websites, in my experience out of ones I browse, assume light mode by default. However, terminals are likely to be in dark mode. Following the recent trend to have websites support both light and dark modes through the
prefers-color-scheme
media query, I think it makes sense for elinks to support this, and have the configurable, egdocument.css.prefers_color_scheme
set to "dark" by default.This allows websites that set light background colors by default, but dark background colors for dark mode, to be shown in dark mode in elinks.
Before opening this issue, I digged through the code base and played around with the CSS parser. It looks like elinks currently only support Media types (
@media type1,type2,type3... {}
/@media type1 {}
).Media features does not seem to be supported, but it was relatively easy to add support for only
(prefers-color-scheme: <light|dark>)
specifically, for now, whilst keeping the existing support (eg@media tty { ... }
).I'm not super confident my patch is robust, but it works fairly well during my testing. I'm interested in opening an PR for it.
The text was updated successfully, but these errors were encountered: