-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add selector as id to layout style overrides. #55291
Conversation
Size Change: 0 B Total Size: 1.65 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is testing well for me, and the code change looks good and safe since the layout and child layout supports use different selectors 👍
There's a proposed PR (#54493) that will improve the ids used by the block supports, but since that one won't be part of 6.4, I think this will be a good fix for 6.4.
LGTM! ✨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confirming that this works for me. The base layout (flex-orientation
) is added as .wp-container-1
, the child layout (flex-grow
) is added as .wp-container-content-1
. And they no longer overwrite each other.
I'm also happy to learn some details about how styles work, I was previously very unfamiliar with this area.
Oooh nice, I missed that one somehow. Thanks for reviewing and testing folks! |
I just cherry-picked this PR to the 6.4-rc1-2 branch to get it included in the next release: dab99ea |
* Add selector as id to layout style overrides. (#55291) * Fix flickering when focusing on global style variations (#55267) * ProgressBar: use text color to ensure enough contrast against background (#55285) * Use text color at different opacities for track and indicator * Add high contrast mode styles * CHANGELOG # Conflicts: # packages/components/CHANGELOG.md * Remove empty attrs. (#54496) * Remove empty attrs. * Fix linter errors --------- Co-authored-by: Sarah Norris <[email protected]> * Add IS_GUTENBERG_PLUGIN flag to LastRevision (#55253) * useBlockPreview: Try outputting EditorStyles to ensure local style overrides are rendered (#55288) * useBlockPreview: Try alternative fix for displaying local style overrides * Avoid duplicate styles, fix rendering issues in Safari * Add more explanatory comments * Remove additional check for styles within the block preview, as it is not needed since EditorStyles handles its own style overrides retrieval * Bug: PHP notice when an image with lightbox is deleted (#55370) * Fix PHP notice when an image with lightbox is deleted * Fix PHP notice when an image with lightbox is deleted --------- Co-authored-by: tellthemachines <[email protected]> Co-authored-by: Aki Hamano <[email protected]> Co-authored-by: Marco Ciampini <[email protected]> Co-authored-by: Jonny Harris <[email protected]> Co-authored-by: Andrew Serong <[email protected]> Co-authored-by: Kishan Jasani <[email protected]>
What?
Fixes #55249.
setStyleOverride
, introduced to layout in #54466, was using the same id for both layout styles and child layout styles, which sometimes coexist in the same block. As a result, adding child layout to a block that already had layout was wiping out the layout styles.This PR changes the id passed to
setStyleOverride
anddeleteStyleOverride
to the CSS selector for the styles, which ensures it won't be the same for layout and child layout.Testing Instructions
(incidentally, the control in Dimensions should show "Height" instead of "Width" for a Stack block. I'll look into that separately 😄 )