Skip to content

Commit cf29b9c

Browse files
authored
Provide copy button container sufficient min height (#1810)
1 parent 2a690ef commit cf29b9c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/pydata_sphinx_theme/assets/styles/extensions/_copybutton.scss

+7
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,10 @@ div.highlight button.copybtn {
4141
outline: $focus-ring-outline;
4242
}
4343
}
44+
45+
div.highlight:has(button.copybtn) {
46+
// Make sure the code block has enough height for the copy button.
47+
// Sphinx-copybutton sets 0.3em top offset plus 1.7em height:
48+
// https://github.com/executablebooks/sphinx-copybutton/blob/master/sphinx_copybutton/_static/copybutton.css
49+
min-height: 2em;
50+
}

0 commit comments

Comments
 (0)