Skip to content

Commit e365fe1

Browse files
committed
remove darkmode
1 parent 1848640 commit e365fe1

File tree

4 files changed

+6
-24
lines changed

4 files changed

+6
-24
lines changed

Doc/whatsnew/3.15.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ Improved modules
217217
calendar
218218
--------
219219

220-
* Calendar pages generated by the :class:`calendar.HTMLCalendar` class now support
221-
dark mode, and migrated the output to the HTML5 standard.
220+
* The calendar pages generated by the :class:`calendar.HTMLCalendar` class now
221+
use the HTML5 standard.
222222
(Contributed by Jiahao Li in :gh:`137634`.)
223223

224224
dbm

Lib/calendar.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -580,12 +580,6 @@ def formatyearpage(self, theyear, width=3, css='calendar.css', encoding=None):
580580
a(f'<meta charset="{encoding}">\n')
581581
a('<meta name="viewport" content="width=device-width, initial-scale=1">\n')
582582
a(f'<title>Calendar for {theyear}</title>\n')
583-
a('<style>\n')
584-
a('@media (prefers-color-scheme: dark) {\n')
585-
a(' body { background-color: #121212; color: #e0e0e0; }\n')
586-
a(' table.year, table.month, td, th { border-color: #444; }\n')
587-
a('}\n')
588-
a('</style>\n')
589583
if css is not None:
590584
a(f'<link rel="stylesheet" href="{css}">\n')
591585
a('</head>\n')

Lib/test/test_calendar.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,21 +113,13 @@
113113

114114
default_format = dict(year="year", month="month", encoding="ascii")
115115

116-
result_2004_css = """<style>
117-
@media (prefers-color-scheme: dark) {
118-
body { background-color: #121212; color: #e0e0e0; }
119-
table.year, table.month, td, th { border-color: #444; }
120-
}
121-
</style>"""
122-
123116
result_2004_html = """\
124117
<!DOCTYPE html>
125118
<html lang="en">
126119
<head>
127120
<meta charset="{encoding}">
128121
<meta name="viewport" content="width=device-width, initial-scale=1">
129122
<title>Calendar for 2004</title>
130-
{css_styles}
131123
<link rel="stylesheet" href="calendar.css">
132124
</head>
133125
<body>
@@ -393,12 +385,10 @@ def check_htmlcalendar_encoding(self, req, res):
393385
cal = calendar.HTMLCalendar()
394386
format_ = default_format.copy()
395387
format_["encoding"] = req or 'utf-8'
396-
format_with_css = {**format_, "css_styles": result_2004_css}
397-
formatted_html = result_2004_html.format(**format_with_css)
398388
output = cal.formatyearpage(2004, encoding=req)
399389
self.assertEqual(
400390
output,
401-
formatted_html.encode(res)
391+
result_2004_html.format(**format_).encode(res)
402392
)
403393

404394
def test_output(self):
@@ -1155,9 +1145,7 @@ def test_html_output_current_year(self):
11551145
def test_html_output_year_encoding(self):
11561146
for run in self.runners:
11571147
output = run('-t', 'html', '--encoding', 'ascii', '2004')
1158-
format_with_css = default_format.copy()
1159-
format_with_css["css_styles"] = result_2004_css
1160-
self.assertEqual(output, result_2004_html.format(**format_with_css).encode('ascii'))
1148+
self.assertEqual(output, result_2004_html.format(**default_format).encode('ascii'))
11611149

11621150
def test_html_output_year_css(self):
11631151
self.assertFailure('-t', 'html', '-c')
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Calendar pages generated by the :class:`calendar.HTMLCalendar` class now
2-
support dark mode, and migrated the output to the HTML5 standard.
1+
The calendar pages generated by the :class:`calendar.HTMLCalendar` class now
2+
use the HTML5 standard.

0 commit comments

Comments
 (0)