Repository navigation
Site Editor: Some global styles dropdowns are misaligned in Styles screen #69764
Copy link
Copy link
Closed
Closed
Copy link
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
The panels such as Color, Typography, etc.. in the Global Styles have an option button on the top right corner:
This button has a calculated prop from the useToolsPanelDropdownMenuProps to position the dropdown to the left of the global styles sidebar.
gutenberg/packages/block-editor/src/components/global-styles/utils.js
Lines 145 to 156 in 9439252
| export function useToolsPanelDropdownMenuProps() { | |
| const isMobile = useViewportMatch( 'medium', '<' ); | |
| return ! isMobile | |
| ? { | |
| popoverProps: { | |
| placement: 'left-start', | |
| // For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px) | |
| offset: 259, | |
| }, | |
| } | |
| : {}; | |
| } |
This prop works well when the panels are in the global styles sidebar,
But not in the Styles screen:
I think the dropdown should be placed like this:
Step-by-step reproduction instructions
- Apperance > Design > Styles
- Click one of the option buttons
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended




Activity
t-hamano commentedon Mar 31, 2025
Note: Before attempting any modifications, it may be a good idea to first discuss what the ideal approach would be.
yogeshbhutkar commentedon Mar 31, 2025
Thanks for the issue, @t-hamano.
I believe it's best to extend
useToolsPanelDropdownMenuPropsfunctionality to allow the usage ofcustom popover propsand fallback to the default ones when they are not defined. Basically, this:t-hamano commentedon Mar 31, 2025
@yogeshbhutkar The key point is that there is currently no way to know where each panel is being rendered.
The only way I can think of is to provide props or context to the
GlobalStylesUIcomponent here so that each panel itself can reference it and determine the position of its popover.talldan commentedon Dec 19, 2025
This still seems to be an issue. It's quite a nasty visual bug.
I vaguely remember when it was first implemented, there was always some awareness that
useToolsPanelDropdownMenuPropsmight have this shortcoming. I don't think it was ever supposed to be embedded in each component, instead used in a way that's its props can be passed in to the component. I think refactors have maybe resulted in the behavior becoming intrinsic to the styles components.I think ideally the Inspector has a way to inject the positioning it requires as a prop. Not sure the best way though, it looks like there's potentially a lot of prop drilling involved. It could perhaps be a prop to the outermost component, and then internally context is used to share the vlaue.
annezazu commentedon Sep 25, 2026
Noting it's still an issue as of WordPress 7.1.2 and Gutenberg 24.0.
t-hamano commentedon Oct 3, 2026
I submitted #84048, although it may not be the ideal approach.