Repository navigation
Conversation
- Added editor styles for accordion blocks to improve visual feedback during editing. - Implemented logic to show outlines on sibling accordion items when the innermost accordion is active. - Updated block.json to include the new editor style for the accordion block. - Introduced a new SCSS file for accordion-specific editor styles.
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @derpaschi! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
What?
Adds editor-only outlines to the Accordion block so users can orient within the accordion structure directly on the canvas, without relying on the List View sidebar.
See #77299
Why?
When editing inside an Accordion with multiple items, there is no visual indication of the block hierarchy on the canvas. It's difficult to tell which item you're in, or how many siblings exist at the current level. This is especially disorienting with nested accordions. The Grid variation of the Group block already solves this problem for grid layouts with its grid visualizer outlines — the Accordion should offer a similar level of spatial awareness.
How?
A lightweight "contextual sibling awareness" model using one new CSS class and a small
editor.scssfile:JS (
accordion/edit.js): AuseSelecthook determines whether this accordion instance is the innermost active one — meaning it contains the selected block and no nested accordion also contains it. Uses the existinggetBlockParentsByBlockNameselector. When active, applies the classis-accordion-editing-activeto the container.CSS (
accordion/editor.scss): Three outline layers, all editor-only:Colors use
color-mix(in srgb, currentColor %, #0000)to match the grid visualizer pattern and adapt to theme context.Nested accordion behavior: Only the innermost level the user is working in shows outlines. When clicking deeper into a nested accordion, the outlines shift to that level. Parent levels go quiet.
Testing Instructions
Testing Instructions for Keyboard
Screenshots
Use of AI Tools
This PR was authored with assistance from Claude Code (Claude Opus). The implementation plan, code review, and all code changes were reviewed and validated by myself.