Skip to content

gh-123430: Add dark mode support to pages generated by http.server #123475

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

Merged
merged 6 commits into from
Sep 3, 2024

Conversation

YorikHansen
Copy link
Contributor

@YorikHansen YorikHansen commented Aug 29, 2024

The error pages and the directory lists generated by http.server did not allow browsers to enable the inbuilt dark mode. This change allows for that by setting the css property color-scheme properly.

The error pages and the directory lists generated by http.server did not allow browsers to enable the inbuilt dark mode. This change allows for that by setting the css property color-scheme properly.
@ghost
Copy link

ghost commented Aug 29, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Aug 29, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main

Testing ./python.exe -m http.server and looking at a directory listing and an error page:

image image

It's the same in light and dark mode on Chrome with macOS.

PR

In dark mode:

image image

And in light mode it's the same as main.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot review the CSS, but I like @hugovk's screenshots and the feature.

@ZeroIntensity
Copy link
Member

Should this get backported? The user seeing the incorrect color scheme sounds like a bug to me.

@vstinner
Copy link
Member

vstinner commented Sep 3, 2024

Should this get backported? The user seeing the incorrect color scheme sounds like a bug to me.

It's a new feature, it should not be backported.

@hugovk
Copy link
Member

hugovk commented Sep 3, 2024

@YorikHansen Please could you also mention this in What's New?

https://docs.python.org/3.14/whatsnew/3.14.html#improved-modules

@hugovk hugovk merged commit 9684f40 into python:main Sep 3, 2024
34 checks passed
@hugovk
Copy link
Member

hugovk commented Sep 3, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants