Skip to content

Commit af191cc

Browse files
authored
Merge pull request #190 from hugovk/admonition-colour
2 parents 97952b5 + 338ed55 commit af191cc

File tree

2 files changed

+93
-5
lines changed

2 files changed

+93
-5
lines changed

python_docs_theme/static/pydoctheme.css

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,76 @@ div.body pre {
242242
border: 1px solid #ac9;
243243
}
244244

245-
div.body div.admonition,
245+
/* Admonitions */
246+
:root {
247+
--admonition-background: #eee;
248+
--admonition-border: #ccc;
249+
--admonition-color: black;
250+
--attention-background: #bbddff5c;
251+
--attention-border: #0000ff36;
252+
--caution-background: #ffc;
253+
--caution-border: #dd6;
254+
--danger-background: #ffe4e4;
255+
--danger-border: red;
256+
--error-background: #ffe4e4;
257+
--error-border: red;
258+
--hint-background: #dfd;
259+
--hint-border: green;
260+
--seealso-background: #ffc;
261+
--seealso-border: #dd6;
262+
--tip-background: #dfd;
263+
--tip-border: green;
264+
--warning-background: #ffe4e4;
265+
--warning-border: red;
266+
}
267+
268+
div.body div.admonition {
269+
background-color: var(--admonition-background);
270+
border: 1px solid var(--admonition-border);
271+
border-radius: 3px;
272+
color: var(--admonition-color);
273+
}
274+
275+
div.body div.admonition.attention {
276+
background-color: var(--attention-background);
277+
border-color: var(--attention-border);
278+
}
279+
280+
div.body div.admonition.caution {
281+
background-color: var(--caution-background);
282+
border-color: var(--caution-border);
283+
}
284+
285+
div.body div.admonition.danger {
286+
background-color: var(--danger-background);
287+
border-color: var(--danger-border);
288+
}
289+
290+
div.body div.admonition.error {
291+
background-color: var(--error-background);
292+
border-color: var(--error-border);
293+
}
294+
295+
div.body div.admonition.hint {
296+
background-color: var(--hint-background);
297+
border-color: var(--hint-border);
298+
}
299+
300+
div.body div.admonition.seealso {
301+
background-color: var(--seealso-background);
302+
border-color: var(--seealso-border);
303+
}
304+
305+
div.body div.admonition.tip {
306+
background-color: var(--tip-background);
307+
border-color: var(--tip-border);
308+
}
309+
310+
div.body div.admonition.warning {
311+
background-color: var(--warning-background);
312+
border-color: var(--warning-border);
313+
}
314+
246315
div.body div.impl-detail {
247316
border-radius: 3px;
248317
}
@@ -251,10 +320,6 @@ div.body div.impl-detail > p {
251320
margin: 0;
252321
}
253322

254-
div.body div.seealso {
255-
border: 1px solid #dddd66;
256-
}
257-
258323
div.body a {
259324
color: #0072aa;
260325
}

python_docs_theme/static/pydoctheme_dark.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,29 @@ div.warning {
113113
background-color: rgba(255, 0, 0, 0.5);
114114
}
115115

116+
/* Admonitions */
117+
:root {
118+
--admonition-background: #ffffff1a;
119+
--admonition-border: currentColor;
120+
--admonition-color: #ffffffde;
121+
--attention-background: #ffffff1a;
122+
--attention-border: currentColor;
123+
--caution-background: #ffff001a;
124+
--caution-border: #dd6;
125+
--danger-background: #f003;
126+
--danger-border: #f66;
127+
--error-background: #f003;
128+
--error-border: #f66;
129+
--hint-background: #0044117a;
130+
--hint-border: green;
131+
--seealso-background: #ffff001a;
132+
--seealso-border: #dd6;
133+
--tip-background: #0044117a;
134+
--tip-border: green;
135+
--warning-background: #ff000033;
136+
--warning-border: #ff6666;
137+
}
138+
116139
aside.topic,
117140
div.topic,
118141
div.note,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

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