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
{{ message }}
Repository navigation
Add :root { color-scheme: light dark; } to http.server directory list and error pages #123430
Allow browsers to apply light or dark themes to the http.server directory list according to the users prefered color scheme.
This can be done by adding the CSS color-scheme property to :root with the value light dark.
:root {
color-scheme: light dark;
}
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
Something similar was discussed previously in #95812. There it was rejected, as "[t]he listing [should] not contain any hardcoded colors".
I agree with this statement, but I think the page should allow browsers to select their own color scheme and don't see it as a "a problem either with [the] configuration or with the browser", as long as the color-scheme property is not set properly.
I think we want to keep the HTML content the simplest as possible. While the feature you suggest is minor, if we accept it, then people might want to push for more things inside this method (e.g., custom colors passed as arguments, additional content, etc) but I believe that this method should be as simple as possible.
I could see this being considered a bugfix instead of a feature, FWIW -- users might think that it's a bug for http.server to not use their default color scheme.
Activity
picnixz commentedon Aug 28, 2024
I think we want to keep the HTML content the simplest as possible. While the feature you suggest is minor, if we accept it, then people might want to push for more things inside this method (e.g., custom colors passed as arguments, additional content, etc) but I believe that this method should be as simple as possible.
cc @serhiy-storchaka as the one that closed the other issue.
ZeroIntensity commentedon Aug 28, 2024
I could see this being considered a bugfix instead of a feature, FWIW -- users might think that it's a bug for
http.serverto not use their default color scheme.hugovk commentedon Aug 30, 2024
PR at #123475.
gh-123430: Add dark mode support to pages generated by http.server (#…
serhiy-storchaka commentedon Sep 4, 2024
I wonder why browsers do not set this by default?
ZeroIntensity commentedon Sep 4, 2024
I would assume that it's because support for dark mode is lost the moment you change any colors with CSS.