Skip to content

Add :root { color-scheme: light dark; } to http.server directory list and error pages #123430

Closed

Description

@YorikHansen

Feature or enhancement

Proposal:

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.

Linked PRs

Activity

  1. picnixz commented on Aug 28, 2024

    @picnixz
    Member

    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.

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Aug 28, 2024
  3. ZeroIntensity commented on Aug 28, 2024

    @ZeroIntensity
    Member

    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.

  4. hugovk commented on Aug 30, 2024

    @hugovk
    Member

    PR at #123475.

  5. added a commit that references this issue on Sep 3, 2024
  6. serhiy-storchaka commented on Sep 4, 2024

    @serhiy-storchaka
    Member

    I wonder why browsers do not set this by default?

  7. ZeroIntensity commented on Sep 4, 2024

    @ZeroIntensity
    Member

    I would assume that it's because support for dark mode is lost the moment you change any colors with CSS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions