diff --git a/src/pydata_sphinx_theme/assets/styles/content/_figures.scss b/src/pydata_sphinx_theme/assets/styles/content/_figures.scss index 05a3fbe00..4f7d6f77a 100644 --- a/src/pydata_sphinx_theme/assets/styles/content/_figures.scss +++ b/src/pydata_sphinx_theme/assets/styles/content/_figures.scss @@ -1,3 +1,12 @@ +figure > a, +figure > a > img, +figure > img, +figure > video { + display: block; + margin-left: auto; + margin-right: auto; +} + figure { a.headerlink { // So that header link doesn't push caption to be off-center. @@ -16,12 +25,18 @@ figure { margin-left: auto; margin-right: auto; margin-top: 0.3rem; + text-align: center; & > p:last-child { // Don't add extra margin to already existing figure bottom margin margin-bottom: 0; } + p { + text-align: start; + display: inline-block; + } + table.table { width: fit-content; margin-left: auto;