Skip to content

Commit f583ff9

Browse files
committed
Add dark mode styling
1 parent b3949bd commit f583ff9

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

scripts/md2html/main.css

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,59 @@ th code {
7070

7171
a.bibref {
7272
text-decoration: underline;
73+
}
74+
75+
@media (prefers-color-scheme: dark) {
76+
body.darkmode {
77+
--toclink-underline: #6a9000;
78+
--toclink-visited-underline: #fff;
79+
}
80+
81+
body.darkmode a,
82+
body.darkmode .tocxref,
83+
body.darkmode .u-url {
84+
color: #6a9000;
85+
}
86+
87+
body.darkmode code {
88+
color: #e66c33;
89+
}
90+
91+
body.darkmode:not(.toc-inline) #toc h2,
92+
body.darkmode h1,
93+
body.darkmode h2,
94+
body.darkmode h3,
95+
body.darkmode h4,
96+
body.darkmode h5,
97+
body.darkmode h6,
98+
body.darkmode #title,
99+
body.darkmode #subtitle,
100+
body.darkmode .toc-inline,
101+
body.darkmode .dt-published {
102+
color: #7bb01c;
103+
}
104+
105+
body.darkmode pre,
106+
body.darkmode table tr:nth-child(2n),
107+
body.darkmode table tr {
108+
background-color: #1e1e1e !important;
109+
color: #dcdcdc;
110+
}
111+
112+
body.darkmode img {
113+
background: transparent;
114+
}
115+
116+
body.darkmode .logo img {
117+
display: none;
118+
}
119+
120+
body.darkmode .logo::before {
121+
content: "";
122+
display: inline-block;
123+
height: 48px;
124+
width: 175px;
125+
background: url("https://raw.githubusercontent.com/OAI/OpenAPI-Style-Guide/refs/heads/main/graphics/bitmap/OpenAPI_Logo_Pantone.png") no-repeat center / contain;
126+
vertical-align: middle;
127+
}
73128
}

0 commit comments

Comments
 (0)