|
476 | 476 | margin-top: -19px; |
477 | 477 | } |
478 | 478 |
|
479 | | -/* nice headers on first paragraph of info/warning boxes */ |
480 | | -.admonition .first { |
481 | | - margin: -12px; |
482 | | - padding: 6px 12px; |
483 | | - margin-bottom: 12px; |
484 | | - color: #fff; |
485 | | - line-height: 1; |
486 | | - display: block; |
487 | | -} |
488 | | -.admonition.warning .first { |
489 | | - background: #f0b37e; |
490 | | -} |
491 | | -.admonition.note .first { |
492 | | - background: #6ab0de; |
493 | | -} |
494 | 479 | .admonition > p:before { |
495 | 480 | margin-right: 4px; /* make room for the exclamation icon */ |
496 | 481 | } |
|
501 | 486 |
|
502 | 487 | /* nicer titles and more space for info and warning logos */ |
503 | 488 |
|
504 | | -div.admonition > .first { |
| 489 | +div.admonition p.admonition-title { |
505 | 490 | background: rgba(0, 0, 0, .05); |
506 | 491 | margin: .5em -1em; |
507 | 492 | margin-top: -.5em !important; |
@@ -1399,12 +1384,11 @@ def depart_code_latex(self, node): |
1399 | 1384 |
|
1400 | 1385 | def visit_admonition_html(self, node): |
1401 | 1386 | self.body.append(self.starttag(node, 'div')) |
1402 | | - self.set_first_last(node) |
1403 | | - if self.settings.env.config.html_theme in ('sphinx_rtd_theme', 'julia'): |
1404 | | - if node.children: |
1405 | | - classes = node.children[0]['classes'] |
1406 | | - if 'last' not in classes: |
1407 | | - classes.extend(['fa', 'fa-exclamation-circle']) |
| 1387 | + if len(node.children) >= 2: |
| 1388 | + node[0]['classes'].append('admonition-title') |
| 1389 | + html_theme = self.settings.env.config.html_theme |
| 1390 | + if html_theme in ('sphinx_rtd_theme', 'julia'): |
| 1391 | + node.children[0]['classes'].extend(['fa', 'fa-exclamation-circle']) |
1408 | 1392 |
|
1409 | 1393 |
|
1410 | 1394 | def depart_admonition_html(self, node): |
|
0 commit comments