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

Style book: reduce margin selector specificity so that it doesn't override global block styles #66895

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Nov 11, 2024

What? How? Why?

Fixes the margin issue reported in

Reducing specificity of style book margin rules so that they don't override user-defined styles.

Testing Instructions

  1. Fire up the style book
  2. Edit the styles for any block that has top/bottom margin controls, e.g., gallery, separator
  3. Ensure that the margin values are not overridden and are reflected in the style book preview

Before

2024-11-11.11.54.59.mp4

After

2024-11-11.11.55.50.mp4

@ramonjd ramonjd added [Type] Bug An existing feature does not function as intended Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Feature] Style Book labels Nov 11, 2024
@ramonjd ramonjd self-assigned this Nov 11, 2024
Copy link

github-actions bot commented Nov 11, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ramonjd <[email protected]>
Co-authored-by: aaronrobertshaw <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

@aaronrobertshaw aaronrobertshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

This is testing as advertised.

My only question is how hard would it be to display the spacing visualizers in the Style Book? The default spacing between Style Book examples makes the "bottom margin" visually look off to me.

I appreciate our spacing visualizers are a bit clunky at the moment so this thought bubble definitely shouldn't block this fix.

🚢

Screen.Recording.2024-11-11.at.6.03.42.pm.mp4

@ramonjd
Copy link
Member Author

ramonjd commented Nov 11, 2024

My only question is how hard would it be to display the spacing visualizers in the Style Book? The default spacing between Style Book examples makes the "bottom margin" visually look off to me.

That's a good question. It would be a cool feature to have the visualizers there. It would be a neat experiment to wrap the example blocks and just see what happens. I guess we'd need to check for spacing support. Not sure.

Thanks for testing!

@ramonjd ramonjd merged commit 17a1809 into trunk Nov 11, 2024
73 checks passed
@ramonjd ramonjd deleted the update/style-book-reduce-margin-specificity branch November 11, 2024 09:21
@github-actions github-actions bot added this to the Gutenberg 19.7 milestone Nov 11, 2024
karthick-murugan pushed a commit to karthick-murugan/gutenberg that referenced this pull request Nov 13, 2024
…bal block styles (WordPress#66895)


Co-authored-by: ramonjd <[email protected]>
Co-authored-by: aaronrobertshaw <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Style Book Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants