Update background image control dropdown height to fit-content#68038
Update background image control dropdown height to fit-content#68038yogeshbhutkar wants to merge 71 commits into
Conversation
|
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. |
|
Thank you for the PR! I believe this button isn’t meant to use the compact style. It seems like the transition to the new 40px size would make sense to keep things cohesive with other elements in the styles section. I’d love to hear what the components maintainers think about this! |
mirka
left a comment
There was a problem hiding this comment.
I don't quite understand — why is this button a ToolbarButton? At first glance it looks like there's some hacky reuse of MediaReplaceFlow, which is not fully appropriate for this context since we're not inside a Toolbar. There's probably some refactoring to be done if we want to reuse it outside of a Toolbar.
I'll also note that the correct height for this Button is 40px.
…te BackgroundImageControls to specify button variant
|
Hi @mirka, thank you for reviewing the PR! You’re absolutely right, the To address this, I explored a few ways to refactor the I’ve implemented these changes and would love to hear your thoughts or suggestions for further improvement! Here's a recent screenshot demonstrating that the recent changes fix the issue: Audio Toolbar is one of the many places that implement the |
| default: ToolbarButton, | ||
| toolbar: ToolbarButton, |
There was a problem hiding this comment.
Leaving the final review to @mirka, but just a side note here.
I'd personally remove default and just make buttonVariant default to toolbar. No need to maintain two variants that do the same thing.
Co-authored-by: tyxla <tyxla@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org>
…PanelBody (WordPress#67906) Co-authored-by: Sukhendu2002 <sukhendu2002@git.wordpress.org> Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: shail-mehta <shailu25@git.wordpress.org>
…ordPress#67879) * Plugin: Fix eligibility check for post types' default rendering mode * Add backport changelog entry Unlinked contributors: CreativeDive. Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
…cks docs (WordPress#67889) Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: shail-mehta <shailu25@git.wordpress.org>
* Create a catalog list of private APIs * Document some private components * Rewrite the introduction * Rewrite the introduction again
…of PanelBody (WordPress#67910) Co-authored-by: prasadkarmalkar <prasadkarmalkar@git.wordpress.org> Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
…f PanelBody (WordPress#67913) Co-authored-by: prasadkarmalkar <prasadkarmalkar@git.wordpress.org> Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
…ordPress#67817) Co-authored-by: afercia <afercia@git.wordpress.org> Co-authored-by: oandregal <oandregal@git.wordpress.org>
Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: anomiex <bjorsch@git.wordpress.org>
…nuItem' (WordPress#67961) Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
…#67880) Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
…ess#67371) * Storybook: Add stories for the text-alignment-control component * Storybook: Update TextAlignmentControl story to follow best practices and simplify the structure * Storybook: Simplify TextAlignmentControl story * Storybook: Simplify the documentation for TextAlignmentControl story Co-authored-by: himanshupathak95 <abcd95@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
* TreeSelect: Deprecate 36px default size * Fix types * Auto-generate readme * Add changelog * Fixup readme Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org>
…ad of PanelBody (WordPress#67898) Co-authored-by: Sukhendu2002 <sukhendu2002@git.wordpress.org> Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
…ecific contexts (WordPress#67738) * Remove patterns from quick inserter * Remove commented code * Removed prioritizePatterns instances where possible ---- Co-authored-by: rohitmathur-7 <rohitmathur7@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org> Co-authored-by: richtabor <richtabor@git.wordpress.org>
…MenuProps hook for placement (WordPress#68019) Co-authored-by: im3dabasia <im3dabasia1@git.wordpress.org> Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
…nformation) (WordPress#65641) * Use Badge for the block type * Wrap when custom name is long enough * Fix calc Co-authored-by: getdave <get_dave@git.wordpress.org> Co-authored-by: draganescu <andraganescu@git.wordpress.org> Co-authored-by: mikachan <mikachan@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: jeryj <jeryj@git.wordpress.org> Co-authored-by: richtabor <richtabor@git.wordpress.org>
…WordPress#68031) * Hide inserter * Comment case Co-authored-by: Sarah Norris <1645628+mikachan@users.noreply.github.com> --------- Co-authored-by: getdave <get_dave@git.wordpress.org> Co-authored-by: MaggieCabrera <onemaggie@git.wordpress.org> Co-authored-by: mikachan <mikachan@git.wordpress.org>
* Fix Choose menu label when a menu has been deleted. * Pass menu ID to useNavigationMenu. Co-authored-by: afercia <afercia@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: draganescu <andraganescu@git.wordpress.org>
* Correct spelling * Fix caps Co-authored-by: getdave <get_dave@git.wordpress.org> Co-authored-by: shail-mehta <shailu25@git.wordpress.org> Co-authored-by: MaggieCabrera <onemaggie@git.wordpress.org>
…r.md." This reverts commit 9cbbe1d.
…Press#65429) * Add deperecation notice for the ButtonGroup component * Address the feedbacks for deprecation for ButtonGroupControl * Add the changelog deprecation message. * Update the changelog comment Co-authored-by: hbhalodia <hbhalodia@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org>
* ActionItem.Slot: Render as MenuGroup by default * Add changelog * Remove redundant `as` rendering in app Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
* Add command to navigate to site editor * No icon, improved label * Modified code to display command other than Site editor * Feedback and suggestion updates --------- Co-authored-by: benazeer-ben <benazeer@git.wordpress.org> Co-authored-by: richtabor <richtabor@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: annezazu <annezazu@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
…ress#67811) * Give style book its own route so it can be linked to directly. * Fix paths to and from global styles. * Use query instead of path * Fix path * Effect for editor settings update
|
Thank you! |


Fixes: #68029
What?
This PR contains a patch for fixing spacing inconsistency in the background image selector button.
How?
As the issue description mentions, the default size of
Toolbar Buttonwas updated tocompact, whose styles are applied using theis-compactclassname.The
is-compactclassname contains a height of32pxas mentioned here:gutenberg/packages/components/src/button/style.scss
Line 298 in 581de9f
gutenberg/packages/base-styles/_variables.scss
Line 99 in 581de9f
Whereas, the heights described in
.components-dropdownapplied to its parent, is actually36pxleading to a mismatch in the parent container and child's heights.gutenberg/packages/block-editor/src/components/background-image-control/style.scss
Line 26 in 581de9f
gutenberg/packages/block-editor/src/components/background-image-control/style.scss
Line 47 in 581de9f
To fix the issue, the heights are updated inside
.components-dropdownto now usefit-contentinstead of using the previously hardcoded value36px.As an alternative, we can also hardcode the height to
32px.File Changed:
> packages/block-editor/src/components/background-image-control/style.scssTesting Instructions
Screenshots