Skip to content

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

Merged
hugovk merged 6 commits into
python:mainfrom
YorikHansen:issue-123430
Sep 3, 2024
Merged

gh-123430: Add dark mode support to pages generated by http.server#123475
hugovk merged 6 commits into
python:mainfrom
YorikHansen:issue-123430

Conversation

@YorikHansen

@YorikHansenYorikHansen commented Aug 29, 2024

Copy link
Copy Markdown
Contributor

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

ghost commented Aug 29, 2024

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app

Copy link
Copy Markdown

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.

Comment threadMisc/NEWS.d/next/Library/2024-08-29-14-51-36.gh-issue-123430.M7wXl9.rst Outdated
…7wXl9.rst
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>

@hugovkhugovk left a comment

Copy link
Copy Markdown
Member

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:

imageimage

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

PR

In dark mode:

imageimage

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

@vstinnervstinner left a comment

Copy link
Copy Markdown
Member

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.

Comment threadMisc/NEWS.d/next/Library/2024-08-29-14-51-36.gh-issue-123430.M7wXl9.rst Outdated
@ZeroIntensity

Copy link
Copy Markdown
Member

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

@vstinner

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

@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:mainSep 3, 2024
@hugovk

Copy link
Copy Markdown
Member

Thank you!

Sign up for freeto 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

@YorikHansen@ZeroIntensity@vstinner@hugovk