Skip to content

Commit 8f85e0f

Browse files
berlin2123pre-commit-ci[bot]trallardgabalafou
authored
center figure and captions inside figwith, while the whole figure is left/right (#1750)
* centered figure while left/right center figure and captions inside figwith, while the whole figure is left/right * Update _figures.scss * Update _figures.scss * [pre-commit.ci] Automatic linting and formatting fixes * Update src/pydata_sphinx_theme/assets/styles/content/_figures.scss --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tania Allard <[email protected]> Co-authored-by: gabalafou <[email protected]>
1 parent 810c6ad commit 8f85e0f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/pydata_sphinx_theme/assets/styles/content/_figures.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
figure > a,
2+
figure > a > img,
3+
figure > img,
4+
figure > video {
5+
display: block;
6+
margin-left: auto;
7+
margin-right: auto;
8+
}
9+
110
figure {
211
a.headerlink {
312
// So that header link doesn't push caption to be off-center.
@@ -16,12 +25,18 @@ figure {
1625
margin-left: auto;
1726
margin-right: auto;
1827
margin-top: 0.3rem;
28+
text-align: center;
1929

2030
& > p:last-child {
2131
// Don't add extra margin to already existing figure bottom margin
2232
margin-bottom: 0;
2333
}
2434

35+
p {
36+
text-align: start;
37+
display: inline-block;
38+
}
39+
2540
table.table {
2641
width: fit-content;
2742
margin-left: auto;

0 commit comments

Comments
 (0)