Skip to content

Commit

Permalink
Twenty Seventeen and Twenty Ten: Fixes gallery captions being at the …
Browse files Browse the repository at this point in the history
…bottom of images.

The margin specified in this theme caused issues when the gallery was placed in another block. This fix covers both themes as the selector is used within both.

Props pevogam, sabernhardt.
Fixes #58362.


git-svn-id: https://develop.svn.wordpress.org/trunk@58634 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
karmatosed committed Jul 3, 2024
1 parent de74333 commit a285228
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/wp-content/themes/twentyeleven/blocks.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ figure[class^="wp-block-"] {
font-size: 12px;
}

[class^="wp-block-"]:not(.wp-block-gallery) figcaption {
[class^="wp-block-"]:not(.wp-block-gallery) > figcaption {
color: #666;
margin-bottom: 1.625em;
max-width: 96%;
Expand All @@ -40,7 +40,7 @@ figure[class^="wp-block-"] {
text-align: left;
}

[class^="wp-block-"]:not(.wp-block-gallery) figcaption:before {
[class^="wp-block-"]:not(.wp-block-gallery) > figcaption:before {
color: #666;
content: '\2014';
font-size: 14px;
Expand All @@ -52,13 +52,13 @@ figure[class^="wp-block-"] {
top: 0;
}

.rtl [class^="wp-block-"]:not(.wp-block-gallery) figcaption {
.rtl [class^="wp-block-"]:not(.wp-block-gallery) > figcaption {
padding-left: 0;
padding-right: 40px;
text-align: right;
}

.rtl [class^="wp-block-"]:not(.wp-block-gallery) figcaption:before {
.rtl [class^="wp-block-"]:not(.wp-block-gallery) > figcaption:before {
left: 0;
margin-left: 5px;
margin-right: 0;
Expand Down
4 changes: 2 additions & 2 deletions src/wp-content/themes/twentyseventeen/assets/css/blocks.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Description: Used to style blocks.

/* Captions */

[class^="wp-block-"]:not(.wp-block-gallery) figcaption {
[class^="wp-block-"]:not(.wp-block-gallery) > figcaption {
font-style: italic;
margin-bottom: 1.5em;
text-align: left;
}

.rtl [class^="wp-block-"]:not(.wp-block-gallery) figcaption {
.rtl [class^="wp-block-"]:not(.wp-block-gallery) > figcaption {
text-align: right;
}

Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyten/blocks.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Description: Used to style blocks.

/* Captions */

[class^="wp-block-"]:not(.wp-block-gallery) figcaption {
[class^="wp-block-"]:not(.wp-block-gallery) > figcaption {
color: #777;
font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyten/editor-blocks.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Description: Used to style blocks in the editor.

/* Caption styles */

[class^="wp-block-"] figcaption {
[class^="wp-block-"]:not(.wp-block-gallery) > figcaption {
color: #777;
font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
}
Expand Down

0 comments on commit a285228

Please sign in to comment.