Skip to content

Commit

Permalink
Fix #9051: html theme: The style for figure are not applied
Browse files Browse the repository at this point in the history
Since docutils-0.17, figure directive starts to output `<figure>` tag.
To support it, this modifies CSS.
  • Loading branch information
tk0miya committed Apr 10, 2021
1 parent deb603f commit 1d1c813
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 23 deletions.
7 changes: 5 additions & 2 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ Bugs fixed

* #9078: autodoc: Async staticmethods and classmethods are considered as non
async coroutine-functions
* #8870: The style of toctree captions has been changed with docutils-0.17
* #9001: The style of ``sidebar`` directive has been changed with docutils-0.17
* #8870, #9001, #9051: html theme: The style are not applied with docutils-0.17

- toctree captions
- The content of ``sidebar`` directive
- figures

Testing
--------
Expand Down
18 changes: 13 additions & 5 deletions sphinx/themes/agogo/static/agogo.css_t
Original file line number Diff line number Diff line change
Expand Up @@ -370,19 +370,25 @@ div.footer .left {

/* Styles copied from basic theme */

img.align-left, .figure.align-left, object.align-left {
img.align-left, figure.align-left, .figure.align-left, object.align-left {
clear: left;
float: left;
margin-right: 1em;
}

img.align-right, .figure.align-right, object.align-right {
img.align-right, figure.align-right, .figure.align-right, object.align-right {
clear: right;
float: right;
margin-left: 1em;
}

img.align-center, .figure.align-center, object.align-center {
img.align-center, figure.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}

img.align-default, figure.align-default, .figure.align-default {
display: block;
margin-left: auto;
margin-right: auto;
Expand All @@ -407,11 +413,13 @@ table caption span.caption-number {
table caption span.caption-text {
}

div.figure p.caption span.caption-number {
div.figure p.caption span.caption-number,
figcaption span.caption-number {
font-style: italic;
}

div.figure p.caption span.caption-text {
div.figure p.caption span.caption-text,
figcaption span.caption-text {
}

/* -- search page ----------------------------------------------------------- */
Expand Down
18 changes: 10 additions & 8 deletions sphinx/themes/basic/static/basic.css_t
Original file line number Diff line number Diff line change
Expand Up @@ -277,25 +277,25 @@ p.rubric {
font-weight: bold;
}

img.align-left, .figure.align-left, object.align-left {
img.align-left, figure.align-left, .figure.align-left, object.align-left {
clear: left;
float: left;
margin-right: 1em;
}

img.align-right, .figure.align-right, object.align-right {
img.align-right, figure.align-right, .figure.align-right, object.align-right {
clear: right;
float: right;
margin-left: 1em;
}

img.align-center, .figure.align-center, object.align-center {
img.align-center, figure.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}

img.align-default, .figure.align-default {
img.align-default, figure.align-default, .figure.align-default {
display: block;
margin-left: auto;
margin-right: auto;
Expand Down Expand Up @@ -458,20 +458,22 @@ td > :last-child {

/* -- figures --------------------------------------------------------------- */

div.figure {
div.figure, figure {
margin: 0.5em;
padding: 0.5em;
}

div.figure p.caption {
div.figure p.caption, figcaption {
padding: 0.3em;
}

div.figure p.caption span.caption-number {
div.figure p.caption span.caption-number,
figcaption span.caption-number {
font-style: italic;
}

div.figure p.caption span.caption-text {
div.figure p.caption span.caption-text,
figcaption span.caption-text {
}

/* -- field list styles ----------------------------------------------------- */
Expand Down
6 changes: 4 additions & 2 deletions sphinx/themes/epub/static/epub.css_t
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,13 @@ table.citation td {

/* -- figures --------------------------------------------------------------- */

div.figure p.caption span.caption-number {
div.figure p.caption span.caption-number,
figcaption span.caption-number {
font-style: italic;
}

div.figure p.caption span.caption-text {
div.figure p.caption span.caption-text,
figcaption span.caption-text {
}

/* -- field list styles ----------------------------------------------------- */
Expand Down
6 changes: 4 additions & 2 deletions sphinx/themes/nonav/static/nonav.css
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,13 @@ table.citation td {

/* -- figures --------------------------------------------------------------- */

div.figure p.caption span.caption-number {
div.figure p.caption span.caption-number,
figcaption span.caption-number {
font-style: italic;
}

div.figure p.caption span.caption-text {
div.figure p.caption span.caption-text,
figcaption span.caption-text {
}

/* -- field list styles ----------------------------------------------------- */
Expand Down
6 changes: 4 additions & 2 deletions sphinx/themes/scrolls/static/scrolls.css_t
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,13 @@ div.viewcode-block:target {
padding: 0 5px;
}

div.figure p.caption span.caption-number {
div.figure p.caption span.caption-number,
figcaption span.caption-number {
font-style: italic;
}

div.figure p.caption span.caption-text {
div.figure p.caption span.caption-text,
figcaption span.caption-text {
}

/* math display */
Expand Down
6 changes: 4 additions & 2 deletions sphinx/themes/traditional/static/traditional.css_t
Original file line number Diff line number Diff line change
Expand Up @@ -743,11 +743,13 @@ div.literal-block-wrapper pre {
margin: 0;
}

div.figure p.caption span.caption-number {
div.figure p.caption span.caption-number,
figcaption span.caption-number {
font-style: italic;
}

div.figure p.caption span.caption-text {
div.figure p.caption span.caption-text,
figcaption span.caption-text {
}

/* :::: MATH DISPLAY :::: */
Expand Down

0 comments on commit 1d1c813

Please sign in to comment.