Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make captions styles more specific #2423

Merged
merged 2 commits into from
Dec 12, 2024
Merged

Conversation

laurelfulford
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

This small PR fixes some consistency issues between the <figcaption> tag and the .wp-caption-text class for the purposes of consistency in older migrated content.

WordPress is inserting this CSS, which is making these two selectors behave differently in the theme:

:root :where(.wp-block-image figcaption) {
  color: #555;
  font-size: 13px;
  text-align: center;
}

This PR overrides that so they display the same.

How to test the changes in this Pull Request:

  1. Apply this PR.
  2. Add an image block with a caption, and below that, add a paragraph block with the CSS class .wp-caption-text.
  3. Compare them on the front-end and in the editor; confirm they use the same colour and same font size.

CleanShot 2024-12-12 at 10 01 41

  1. Test a couple different themes to make sure the styles are consistent (eg. Katharine should have a little accent; Sacha should be bold, etc):

CleanShot 2024-12-12 at 10 02 11

CleanShot 2024-12-12 at 10 03 08

  1. Try switching the heading font under Customizer > Typography and confirm that both caption-types pick it up.
    CleanShot 2024-12-12 at 10 04 24

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@laurelfulford laurelfulford added the [Status] Needs Review The issue or pull request needs to be reviewed label Dec 12, 2024
@laurelfulford laurelfulford requested a review from a team as a code owner December 12, 2024 18:04
@leogermani
Copy link
Contributor

The paragraph still looks a bit bigger on my end

image

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Dec 12, 2024
@laurelfulford
Copy link
Contributor Author

Thanks @leogermani! 🙌

@laurelfulford laurelfulford merged commit b6f3c5b into trunk Dec 12, 2024
4 checks passed
@laurelfulford laurelfulford deleted the fix/caption-styles branch December 12, 2024 18:45
Copy link

Hey @laurelfulford, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

matticbot pushed a commit that referenced this pull request Dec 12, 2024
## [2.4.1-alpha.1](v2.4.0...v2.4.1-alpha.1) (2024-12-12)

### Bug Fixes

* make captions styles more specific ([#2423](#2423)) ([b6f3c5b](b6f3c5b))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 2.4.1-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Dec 16, 2024
## [2.4.2](v2.4.1...v2.4.2) (2024-12-16)

### Bug Fixes

* make captions styles more specific ([#2423](#2423)) ([b6f3c5b](b6f3c5b))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 2.4.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants