Skip to content

Move and update ButtonBlockAppender styles into component stylesheet + improvements #70472

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

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

wwdes
Copy link
Contributor

@wwdes wwdes commented Jun 18, 2025

What?

Fixes #70179. Improves appender appearance at various layout configuartions.

Why?

Several issues with CSS related to the ButtonBlockAppender component including:

  • Parts of CSS is in the group block's directory, but should be within the component directory.
  • CSS selectors in component directory targeting group block specifically, but should be block-agnostic.
  • Appender's Click state not working when nested (group in group or column in columns)
  • Visual cue when dragging blocks over empty blocks not working as expected.
  • Appender is not placed correctly in flex layouts.
  • Some old and unused CSS that can be removed.

How?

Relocated all styles for ButtonBlockAppender out of the group block’s CSS and into the component’s own stylesheet. Updated the CSS to ensure the appender elements appear where a block's content would appear, and extend layout.js to emit the new class names required by those styles. Addressed drag-over and click state issues. Cleaned up unused CSS related to the component.

layout.js already emits classes that indicate horizontal flex alignment (justification), but does not emit anything for vertical flex alignment. The CSS fix in this PR requires a class that indicates if a block has vertical alignment stretched (is-vertical-alignment-stretch).

Testing Instructions

Play with empty group block or a block that supports inner blocks and layout and uses ButtonBlockAppender. Test switching layouts and setting min-height to see how styles adapt. Test how styles appear on column block.

Screenshots or screencast

Flex layout improvement

Before

appender-fix-before.mp4

After

appender-fix-after.mp4

Drag-over fix

Before

drag-over-before.mp4

After

drag-over-after.mp4

Click state fix

Before

nested-click-state-before

After

nested-click-state-after

wwdes added 2 commits June 19, 2025 13:24
Relocate all styles for ButtonBlockAppender out of the group block’s CSS and into the component’s own stylesheet. Update the CSS to ensure the appender elements appears where a block's content would appear, and extend layout.js to emit the new class names required by those styles. Clean up unused CSS related to the component.
@wwdes wwdes force-pushed the update/button-block-appender-css branch from b288fc3 to 55bd033 Compare June 19, 2025 11:25
@wwdes wwdes marked this pull request as ready for review June 19, 2025 12:11
Copy link

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: wwdes <[email protected]>
Co-authored-by: t-hamano <[email protected]>

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

@shail-mehta shail-mehta added [Type] Bug An existing feature does not function as intended [Block] Group Affects the Group Block (and row, stack and grid variants) CSS Styling Related to editor and front end styles, CSS-specific issues. labels Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Group Affects the Group Block (and row, stack and grid variants) CSS Styling Related to editor and front end styles, CSS-specific issues. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

button-block-appender css selectors should not target group block specifically.
2 participants