Skip to content

Commit c5e84ba

Browse files
authored
Merge pull request #2672 from w3c/dark-mode
Added dark mode to the core spec
2 parents ce61b1d + 3c3f9e5 commit c5e84ba

File tree

4 files changed

+58
-7
lines changed

4 files changed

+58
-7
lines changed

epub33/a11y/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="utf-8" />
55
<title>EPUB Accessibility 1.1</title>
6+
<meta name="color-scheme" content="light dark">
67
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove"></script>
78
<script src="../common/js/fix-errata.js" class="remove"></script>
89
<script src="../common/js/css-inline.js" class="remove"></script>

epub33/common/css/common.css

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ dl.elemdef dfn {
4848
}
4949

5050
/* EBNF tables */
51-
52-
5351
table.productionset {
5452
border: none;
5553
border-left: 5px solid rgb(145,200,255);
@@ -169,8 +167,6 @@ td[headers="tbl-cmt-appl"] {
169167
}
170168

171169

172-
173-
174170
/****************************************************/
175171
/* property tables */
176172
/****************************************************/
@@ -249,7 +245,6 @@ table.prefix caption {
249245
font-size: 90%
250246
}
251247

252-
253248
/* Table zebra style... */
254249

255250
table.zebra {
@@ -286,7 +281,6 @@ table.zebra tr:nth-child(even) {
286281
table.zebra th{border-bottom:1px solid #bbb;padding:.2em 1em;}
287282
table.zebra td{border-bottom:1px solid #ddd;padding:.2em 1em;}
288283

289-
290284
p.support {
291285
border-left: 0.4rem solid rgb(255,255,0);
292286
background-color: rgb(255,255,230);
@@ -327,3 +321,57 @@ a.epubcheck {
327321
background-color: antiquewhite ;
328322
}
329323

324+
/***************** Dark mode settings ******************/
325+
326+
body.darkmode details.explanation, body.darkmode details.desc {
327+
color: black;
328+
background-color: hsla(240, 0%, 68%, 1.0);
329+
}
330+
331+
body.darkmode table.zebra tr:nth-child(even) {
332+
color: black;
333+
}
334+
335+
body.darkmode dl.elemdef,
336+
body.darkmode table.tabledef th,
337+
body.darkmode table.tabledef td,
338+
body.darkmode table.productionset
339+
{
340+
background-color: hsl(240, 0%, 20%);
341+
color: #ddd
342+
}
343+
344+
body.darkmode table.tabledef div.note {
345+
background: hsl(0, 0%, 15%);
346+
}
347+
348+
body.darkmode p.caution, body.darkmode div.caution {
349+
background-color: hsl(180, 40%, 20%);
350+
}
351+
352+
body.darkmode div.caution-title > span {
353+
color: rgb(255,140,0)
354+
}
355+
356+
body.darkmode details.respec-tests-details[open] {
357+
background-color: antiquewhite;
358+
color: black;
359+
}
360+
361+
body.darkmode details.explanation a,
362+
body.darkmode table.productionset a
363+
{
364+
color: hsla(213, 100%, 48%, 1.0);
365+
}
366+
367+
body.darkmode table.prefix th {
368+
color: hsl(66, 100%, 95%);
369+
}
370+
371+
body.darkmode img {
372+
background: hsl(48, 33%, 93%) ;
373+
}
374+
375+
376+
377+

epub33/core/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
33
<head>
44
<meta charset="utf-8" />
5-
<title>EPUB 3.3</title>
5+
<title>EPUB 3.3</title>
6+
<meta name="color-scheme" content="light dark">
67
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove"></script>
78
<script src="./biblio.js" class="remove"></script>
89
<script src="../common/js/fix-errata.js" class="remove"></script>

epub33/rs/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="utf-8" />
55
<title>EPUB Reading Systems 3.3</title>
6+
<meta name="color-scheme" content="light dark">
67
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove"></script>
78
<script src="../common/js/fix-errata.js" class="remove"></script>
89
<script src="../common/js/css-inline.js" class="remove"></script>

0 commit comments

Comments
 (0)