Skip to content

Commit b4a670f

Browse files
authored
spacing in admonitions (#207)
1 parent 79bfd3a commit b4a670f

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

pydata_sphinx_theme/static/css/index.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/scss/_admonitions.scss

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
// Admonitions CSS inspired by https://squidfunk.github.io/mkdocs-material/getting-started/
22
.admonition {
3-
margin: 1.5625em 0 !important;
4-
padding: 0 .6rem !important;
3+
width: 95%;
4+
margin: 1.5625em auto;
5+
padding: 0 .6rem .8rem .6rem !important;
56
overflow: hidden;
67
page-break-inside: avoid;
78
border-left: .2rem solid $blue;
89
border-radius: .1rem;
910
box-shadow: 0 0.2rem 0.5rem rgba(0,0,0,.05), 0 0 0.05rem rgba(0,0,0,.1);
1011
transition: color 250ms,background-color 250ms,border-color 250ms;
1112

12-
// Last paragraph should have same spacing as title
13-
p:last-child {
14-
margin-bottom: 0.4em;
13+
// Last item should have no spacing since we'll control that w/ padding
14+
*:last-child {
15+
margin-bottom: 0;
16+
}
17+
18+
// Items after the title should be indented
19+
p.admonition-title ~ * {
20+
padding: 0 1.4rem;
1521
}
1622

1723
// Defaults for all admonitions

0 commit comments

Comments
 (0)