Debian Codegraph @

docs/templates/css.mako

raw
1 <%!
2 from pdoc.html_helpers import minify_css
3 %>
4
5 <%def name="mobile()" filter="minify_css">
6 :root {
7 --highlight-color: #fe9;
8 }
9 .flex {
10 display: flex !important;
11 }
12
13 body {
14 line-height: 1.5em;
15 }
16
17 #content {
18 padding: 20px;
19 }
20
21 #sidebar {
22 padding: 30px;
23 overflow: hidden;
24 }
25 #sidebar > *:last-child {
26 margin-bottom: 2cm;
27 }
28
29 % if lunr_search is not None:
30 #lunr-search {
31 width: 100%;
32 font-size: 1em;
33 padding: 6px 9px 5px 9px;
34 border: 1px solid silver;
35 }
36 % endif
37
38 .http-server-breadcrumbs {
39 font-size: 130%;
40 margin: 0 0 15px 0;
41 }
42
43 #footer {
44 font-size: .75em;
45 padding: 5px 30px;
46 border-top: 1px solid #ddd;
47 text-align: right;
48 }
49 #footer p {
50 margin: 0 0 0 1em;
51 display: inline-block;
52 }
53 #footer p:last-child {
54 margin-right: 30px;
55 }
56
57 h1, h2, h3, h4, h5 {
58 font-weight: 300;
59 }
60 h1 {
61 font-size: 2.5em;
62 line-height: 1.1em;
63 }
64 h2 {
65 font-size: 1.75em;
66 margin: 1em 0 .50em 0;
67 }
68 h3 {
69 font-size: 1.4em;
70 margin: 25px 0 10px 0;
71 }
72 h4 {
73 margin: 0;
74 font-size: 105%;
75 }
76 h1:target,
77 h2:target,
78 h3:target,
79 h4:target,
80 h5:target,
81 h6:target {
82 background: var(--highlight-color);
83 padding: .2em 0;
84 }
85
86 a {
87 color: #058;
88 text-decoration: none;
89 transition: color .3s ease-in-out;
90 }
91 a:hover {
92 color: #e82;
93 }
94
95 .title code {
96 font-weight: bold;
97 }
98 h2[id^="header-"] {
99 margin-top: 2em;
100 }
101 .ident {
102 color: #900;
103 }
104
105 pre code {
106 background: #f8f8f8;
107 font-size: .8em;
108 line-height: 1.15em;
109 }
110 code {
111 background: #f2f2f1;
112 padding: 1px 4px;
113 overflow-wrap: break-word;
114 }
115 h1 code { background: transparent }
116
117 pre {
118 background: #f8f8f8;
119 border: 0;
120 border-top: 1px solid #ccc;
121 border-bottom: 1px solid #ccc;
122 margin: 1em 0;
123 padding: 1ex;
124 }
125
126 #http-server-module-list {
127 display: flex;
128 flex-flow: column;
129 }
130 #http-server-module-list div {
131 display: flex;
132 }
133 #http-server-module-list dt {
134 min-width: 10%;
135 }
136 #http-server-module-list p {
137 margin-top: 0;
138 }
139
140 .toc ul,
141 #index {
142 list-style-type: none;
143 margin: 0;
144 padding: 0;
145 }
146 #index code {
147 background: transparent;
148 }
149 #index h3 {
150 border-bottom: 1px solid #ddd;
151 }
152 #index ul {
153 padding: 0;
154 }
155 #index h4 {
156 margin-top: .6em;
157 font-weight: bold;
158 }
159 /* Make TOC lists have 2+ columns when viewport is wide enough.
160 Assuming ~20-character identifiers and ~30% wide sidebar. */
161 @media (min-width: 200ex) { #index .two-column { column-count: 2 } }
162 @media (min-width: 300ex) { #index .two-column { column-count: 3 } }
163
164 dl {
165 margin-bottom: 2em;
166 }
167 dl dl:last-child {
168 margin-bottom: 4em;
169 }
170 dd {
171 margin: 0 0 1em 3em;
172 }
173 #header-classes + dl > dd {
174 margin-bottom: 3em;
175 }
176 dd dd {
177 margin-left: 2em;
178 }
179 dd p {
180 margin: 10px 0;
181 }
182 .name {
183 background: #eee;
184 font-weight: bold;
185 font-size: .85em;
186 padding: 5px 10px;
187 display: inline-block;
188 min-width: 40%;
189 }
190 .name:hover {
191 background: #e0e0e0;
192 }
193 dt:target .name {
194 background: var(--highlight-color);
195 }
196 .name > span:first-child {
197 white-space: nowrap;
198 }
199 .name.class > span:nth-child(2) {
200 margin-left: .4em;
201 }
202 .inherited {
203 color: #999;
204 border-left: 5px solid #eee;
205 padding-left: 1em;
206 }
207 .inheritance em {
208 font-style: normal;
209 font-weight: bold;
210 }
211
212 /* Docstrings titles, e.g. in numpydoc format */
213 .desc h2 {
214 font-weight: 400;
215 font-size: 1.25em;
216 }
217 .desc h3 {
218 font-size: 1em;
219 }
220 .desc dt code {
221 background: inherit; /* Don't grey-back parameters */
222 }
223
224 .source summary,
225 .git-link-div {
226 color: #666;
227 text-align: right;
228 font-weight: 400;
229 font-size: .8em;
230 text-transform: uppercase;
231 }
232 .source summary > * {
233 white-space: nowrap;
234 cursor: pointer;
235 }
236 .git-link {
237 color: inherit;
238 margin-left: 1em;
239 }
240 .source pre {
241 max-height: 500px;
242 overflow: auto;
243 margin: 0;
244 }
245 .source pre code {
246 font-size: 12px;
247 overflow: visible;
248 }
249 .hlist {
250 list-style: none;
251 }
252 .hlist li {
253 display: inline;
254 }
255 .hlist li:after {
256 content: ',\2002';
257 }
258 .hlist li:last-child:after {
259 content: none;
260 }
261 .hlist .hlist {
262 display: inline;
263 padding-left: 1em;
264 }
265
266 img {
267 max-width: 100%;
268 }
269 td {
270 padding: 0 .5em;
271 }
272
273 .admonition {
274 padding: .1em .5em;
275 margin-bottom: 1em;
276 }
277 .admonition-title {
278 font-weight: bold;
279 }
280 .admonition.note,
281 .admonition.info,
282 .admonition.important {
283 background: #aef;
284 }
285 .admonition.todo,
286 .admonition.versionadded,
287 .admonition.tip,
288 .admonition.hint {
289 background: #dfd;
290 }
291 .admonition.warning,
292 .admonition.versionchanged,
293 .admonition.deprecated {
294 background: #fd4;
295 }
296 .admonition.error,
297 .admonition.danger,
298 .admonition.caution {
299 background: lightpink;
300 }
301 </%def>
302
303 <%def name="desktop()" filter="minify_css">
304 @media screen and (min-width: 700px) {
305 #sidebar {
306 width: 30%;
307 height: 100vh;
308 overflow: auto;
309 position: sticky;
310 top: 0;
311 }
312 #content {
313 width: 70%;
314 max-width: 100ch;
315 padding: 3em 4em;
316 border-left: 1px solid #ddd;
317 }
318 pre code {
319 font-size: 1em;
320 }
321 .item .name {
322 font-size: 1em;
323 }
324 main {
325 display: flex;
326 flex-direction: row-reverse;
327 justify-content: flex-end;
328 }
329 .toc ul ul,
330 #index ul {
331 padding-left: 1.5em;
332 }
333 .toc > ul > li {
334 margin-top: .5em;
335 }
336 }
337 </%def>
338
339 <%def name="print()" filter="minify_css">
340 @media print {
341 #sidebar h1 {
342 page-break-before: always;
343 }
344 .source {
345 display: none;
346 }
347 }
348 @media print {
349 * {
350 background: transparent !important;
351 color: #000 !important; /* Black prints faster: h5bp.com/s */
352 box-shadow: none !important;
353 text-shadow: none !important;
354 }
355
356 a[href]:after {
357 content: " (" attr(href) ")";
358 font-size: 90%;
359 }
360 /* Internal, documentation links, recognized by having a title,
361 don't need the URL explicity stated. */
362 a[href][title]:after {
363 content: none;
364 }
365
366 abbr[title]:after {
367 content: " (" attr(title) ")";
368 }
369
370 /*
371 * Don't show links for images, or javascript/internal links
372 */
373
374 .ir a:after,
375 a[href^="javascript:"]:after,
376 a[href^="#"]:after {
377 content: "";
378 }
379
380 pre,
381 blockquote {
382 border: 1px solid #999;
383 page-break-inside: avoid;
384 }
385
386 thead {
387 display: table-header-group; /* h5bp.com/t */
388 }
389
390 tr,
391 img {
392 page-break-inside: avoid;
393 }
394
395 img {
396 max-width: 100% !important;
397 }
398
399 @page {
400 margin: 0.5cm;
401 }
402
403 p,
404 h2,
405 h3 {
406 orphans: 3;
407 widows: 3;
408 }
409
410 h1,
411 h2,
412 h3,
413 h4,
414 h5,
415 h6 {
416 page-break-after: avoid;
417 }
418 }
419 </%def>