pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/pull/123475/files

f="https://github.githubassets.com/assets/primer-primitives-10bf9dd67e3d70bd.css" /> gh-123430: Add dark mode support to pages generated by http.server by YorikHansen · Pull Request #123475 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ Added support for converting any objects that have the
(Contributed by Serhiy Storchaka in :gh:`82017`.)


http
----

Directory lists and error pages generated by the :mod:`http.server`
module allow the browser to apply its default dark mode.
(Contributed by Yorik Hansen in :gh:`123430`.)


json
----

Expand Down
6 changes: 6 additions & 0 deletions Lib/http/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@
<html lang="en">
<head>
<meta charset="utf-8">
<style type="text/css">
:root {
color-scheme: light dark;
}
</style>
<title>Error response</title>
</head>
<body>
Expand Down Expand Up @@ -804,6 +809,7 @@ def list_directory(self, path):
r.append('<html lang="en">')
r.append('<head>')
r.append(f'<meta charset="{enc}">')
r.append('<style type="text/css">\n:root {\ncolor-scheme: light dark;\n}\n</style>')
r.append(f'<title>{title}</title>\n</head>')
r.append(f'<body>\n<h1>{title}</h1>')
r.append('<hr>\n<ul>')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pages generated by the :mod:`http.server` module allow the browser to apply its default dark mode.
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy