Skip to content

Commit

Permalink
Support dark color-scheme
Browse files Browse the repository at this point in the history
This patch updates the html documentation to add the color-scheme meta
element, signaling ligth and dark color scheme support, and updating the
inline CSS styles to override some colors when dark mode is active, to
make sure that the document is always readable.

I've also cleaned up a bit the CSS styles, but without functional
changes.
  • Loading branch information
Tachi107 authored and HowardHinnant committed Sep 28, 2024
1 parent 88d9e5c commit 8eeae97
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 75 deletions.
17 changes: 7 additions & 10 deletions chrono_io.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@
<head>
<title>chrono_io</title>

<meta name="color-scheme" content="light dark" />
<style>
p {text-align:justify}
li {text-align:justify}
blockquote.note
{
background-color:#E0E0E0;
padding-left: 15px;
padding-right: 15px;
padding-top: 1px;
padding-bottom: 1px;
}
li, p {text-align:justify}
ins {color:#00A000}
del {color:#A00000}
code {white-space:pre;}
@media (prefers-color-scheme: dark)
{
ins {color:#88FF88}
del {color:#FF5555}
}
</style>
</head>
<body>
Expand Down
28 changes: 13 additions & 15 deletions d0355r7.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,11 @@
<html>
<head>
<meta charset="utf-8">
<meta name="color-scheme" content="light dark">
<title>Extending &lt;chrono&gt; to Calendars and Time Zones</title>
<style type="text/css">
p {text-align:justify}
li {text-align:justify}
blockquote.note
{
background-color:#E0E0E0;
padding-left: 15px;
padding-right: 15px;
padding-top: 1px;
padding-bottom: 1px;
}
p.note
<style type="text/css">
li, p {text-align:justify}
blockquote.note, p.note
{
background-color:#E0E0E0;
padding-left: 15px;
Expand All @@ -25,11 +17,17 @@
}
ins {color:#00A000}
del {color:#A00000}
address {text-align:right;}
h1 {text-align:center;}
span.comment {color:#C80000;}
address {text-align:right;}
h1 {text-align:center;}
code {white-space:pre;}
@media (prefers-color-scheme: dark)
{
blockquote.note, p.note {background-color:#505050}
ins {color:#88FF88}
del {color:#FF5555}
}
</style>

</head>
<body>

Expand Down
17 changes: 7 additions & 10 deletions date.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@
<head>
<title>date</title>

<meta name="color-scheme" content="light dark" />
<style>
p {text-align:justify}
li {text-align:justify}
blockquote.note
{
background-color:#E0E0E0;
padding-left: 15px;
padding-right: 15px;
padding-top: 1px;
padding-bottom: 1px;
}
li, p {text-align:justify}
ins {color:#00A000}
del {color:#A00000}
code {white-space:pre;}
@media (prefers-color-scheme: dark)
{
ins {color:#88FF88}
del {color:#FF5555}
}
</style>
</head>
<body>
Expand Down
17 changes: 7 additions & 10 deletions islamic.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@
<head>
<title>islamic</title>

<meta name="color-scheme" content="light dark" />
<style>
p {text-align:justify}
li {text-align:justify}
blockquote.note
{
background-color:#E0E0E0;
padding-left: 15px;
padding-right: 15px;
padding-top: 1px;
padding-bottom: 1px;
}
li, p {text-align:justify}
ins {color:#00A000}
del {color:#A00000}
code {white-space:pre;}
@media (prefers-color-scheme: dark)
{
ins {color:#88FF88}
del {color:#FF5555}
}
</style>
</head>
<body>
Expand Down
17 changes: 7 additions & 10 deletions iso_week.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@
<head>
<title>iso_week</title>

<meta name="color-scheme" content="light dark" />
<style>
p {text-align:justify}
li {text-align:justify}
blockquote.note
{
background-color:#E0E0E0;
padding-left: 15px;
padding-right: 15px;
padding-top: 1px;
padding-bottom: 1px;
}
li, p {text-align:justify}
ins {color:#00A000}
del {color:#A00000}
code {white-space:pre;}
@media (prefers-color-scheme: dark)
{
ins {color:#88FF88}
del {color:#FF5555}
}
</style>
</head>
<body>
Expand Down
17 changes: 7 additions & 10 deletions julian.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@
<head>
<title>julian</title>

<meta name="color-scheme" content="light dark" />
<style>
p {text-align:justify}
li {text-align:justify}
blockquote.note
{
background-color:#E0E0E0;
padding-left: 15px;
padding-right: 15px;
padding-top: 1px;
padding-bottom: 1px;
}
li, p {text-align:justify}
ins {color:#00A000}
del {color:#A00000}
code {white-space:pre;}
@media (prefers-color-scheme: dark)
{
ins {color:#88FF88}
del {color:#FF5555}
}
</style>
</head>
<body>
Expand Down
17 changes: 7 additions & 10 deletions tz.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@
<head>
<title>Time Zone Database Parser</title>

<meta name="color-scheme" content="light dark" />
<style>
p {text-align:justify}
li {text-align:justify}
blockquote.note
{
background-color:#E0E0E0;
padding-left: 15px;
padding-right: 15px;
padding-top: 1px;
padding-bottom: 1px;
}
li, p {text-align:justify}
ins {color:#00A000}
del {color:#A00000}
code {white-space:pre;}
@media (prefers-color-scheme: dark)
{
ins {color:#88FF88}
del {color:#FF5555}
}
</style>
</head>
<body>
Expand Down

0 comments on commit 8eeae97

Please sign in to comment.