Skip to content

Commit 39d973f

Browse files
committed
DOC: Fix selection of parameter names in HTML theme
Parameters are written in HTML as (leaving out some internal classes): ``` <strong>name</strong><span class="classifier"><a><code><span>TypeName</span></code></a></span> ``` but in rendered form there's a colon between the name and type. This colon is inserted virtually using CSS, but since it doesn't exist, the browser thinks both sides are part of the same word. Styling the virtual text as inline block makes it be treated as a break, but also makes it apply vertical margins, so we need to set those to zero again. Fixes matplotlib#21432.
1 parent 5f0e6df commit 39d973f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

doc/_static/mpl.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,11 @@ div.twocol > div {
245245
padding: 0;
246246
margin: 0;
247247
}
248+
249+
/* Fix selection of parameter names; remove when fixed in the theme
250+
* https://github.com/sphinx-doc/sphinx/pull/9763
251+
*/
252+
.classifier:before {
253+
display: inline-block;
254+
margin: 0 0.5em;
255+
}

0 commit comments

Comments
 (0)