Skip to content

Commit 196c77a

Browse files
authored
Improve docstring headings, including admonition blocks (#2202)
- Preserves intended admonition block heading styles in docstring content. - Removes uppercasing of all docstring h4s - authors' casing to be respected. - Slightly increases docstring h2 size, allowing differentiation of h2-h4. Fixes #2201
1 parent 7571856 commit 196c77a

1 file changed

Lines changed: 14 additions & 16 deletions

File tree

assets/css/content/functions.css

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,21 @@ in both HTML and ePub. */
8585
}
8686
}
8787

88-
/* Docstring headings */
8988
.content-inner .docstring {
90-
& :is(h1, h2, h3, h4, h5, h6) {
91-
font-weight: 700;
92-
font-size: 1em;
93-
margin-top: 2em;
94-
}
95-
/* h1 not expected */
96-
& :is(h1, h2) {
97-
font-size: 1.1em;
98-
}
99-
/* h4 the last level expected: smallcaps */
100-
& :is(h4) {
101-
font-size: .8em;
102-
text-transform: uppercase;
103-
letter-spacing: .1em;
104-
color: var(--textBody);
89+
/* Docstring headings: h2-h4 expected; should not apply to admonition blocks within docstring. */
90+
& :not(.admonition-title) {
91+
&:is(h1, h2, h3, h4, h5, h6) {
92+
font-weight: 700;
93+
font-size: 1em;
94+
margin-top: 2em;
95+
}
96+
/* h1 not expected */
97+
&:is(h1, h2) {
98+
font-size: 1.25em;
99+
}
100+
&:is(h3) {
101+
font-size: 1.1em;
102+
}
105103
}
106104
}
107105

0 commit comments

Comments
 (0)