Move and update ButtonBlockAppender styles into component stylesheet + improvements
What?
Fixes https://github.com/WordPress/gutenberg/issues/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, layout settings 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
| Before | After |
|---|
https://github.com/user-attachments/assets/2cdee972-fdc8-413e-b382-20a8eca826dc
|
https://github.com/user-attachments/assets/fdd6762d-f360-41a8-a36e-9dda06d5eee3