[EuiButton][EuiButtonEmpty] Update button paddings#8948
Conversation
- adds additional 4px padding on text content and adjusts button padding per size
ff31b48 to
17f17b5
Compare
|
Hey @mgadewoll, thank you! The changes look good, one ask please — could we adjust the text box for empty XS buttons to be 2px rather than 4px? |
@ek-so Sure 👍 The label has now Screen.Recording.2025-08-07.at.14.13.30.mov |
feb43b3 to
0efc86f
Compare
acstll
left a comment
There was a problem hiding this comment.
I strictly followed the suggested steps for QA (thanks for providing those!) and it's all looking good.
I only left 2 remarks, only one may require action, which is a possible Amsterdam regression
- Amsterdam: padding for text content is there but it wasn't before (I think I spotted the place in the code)
- [no action] the layout in EuiSearchBar / EuiSearchBarFilters gets weird in small viewports but I don't think it matters
packages/eui/src/components/button/button_display/_button_display_content.styles.ts
Show resolved
Hide resolved
| }) | ||
| ), | ||
| uncompressed: ` | ||
| &:not(:has(> ${buttons}:first-child, > *:first-child > ${buttons})) { |
There was a problem hiding this comment.
[no action required] this caught my attention, probably because of the complexity, but I think it was there already higher up in the file, so I wouldn't touch and I also don't think it's actually bad
There was a problem hiding this comment.
Yeah, that's been around already. Since the form layout API allows to pass anything (e.g. buttons) currently, this is how some styles are selectively targeted.
Yeah, this is expected as is currently. The filters wrap in a flex layout and the width changes due to the content padding. |
💚 Build SucceededHistory
cc @mgadewoll |
💚 Build Succeeded
History
cc @mgadewoll |
acstll
left a comment
There was a problem hiding this comment.
🟢 Thanks for the clarifications and the update, looks good to merge!
5c0a7fc
into
elastic:feat/visual-refresh-append-prepend-updates
## Dependency updates - `@elastic/eui` - v112.3.0 ⏩ v113.0.0 - `@elastic/eui-theme-borealis` - v5.4.0 ⏩ v6.0.0 - `@elastic/eslint-plugin-eui` - v2.8.0 ⏩ v2.9.0 --- ## Changes 1. EUI component update: API and Design updates to form layout append/prepend by using the new components `EuiFormPrepend` and `EuiFormAppend` (EUI [#9308](elastic/eui#9308)) >[!important] ❗ This upgrade PR includes all changes previously made in the specific QA PR #248805. Please see the description in that PR for detailed information about the specific changes. 2. Additional changes related to the form layout changes >[!note] 🔗 Please see the [section "Additional changes"](#248805 (comment)) in #248805 for an overview of additional changes. 3. Removed token update: Replaced `ghost` and `ink` token usages with `textInk` or `plainDark` and `textGhost` or `plainLight` respectively (EUI [#9379](elastic/eui#9379)) ## Package updates ### `@elastic/eui` [v113.0.0](https://github.com/elastic/eui/releases/tag/v113.0.0) - Updated `EuiFlyout` manager to close all flyouts when a parent flyout is closed. ([#9378](elastic/eui#9378)) - Added `textInk` and `textGhost` color tokens for text and icon colors that should always remain dark or light regardless of color mode. ([#9379](elastic/eui#9379)) - Added `EuiFormAppend` and `EuiFormPrepend` components ([#9014](elastic/eui#9014)) - Added support for `type="span"` on `EuiFormLabel` for visual-only form labels ([#9014](elastic/eui#9014)) - Updated `EuiFormLabel` to render a `span` if no `htmlFor` is passed ([#9014](elastic/eui#9014)) - Updated `EuiFormControlLayout` to use `EuiFormAppend` and `EuiFormPrepend` ([#9014](elastic/eui#9014)) - Updated `EuiAutoRefresh` and `EuiColorPicker` to use `EuiFormPrepend` ([#9014](elastic/eui#9014)) - Updated `EuiFormAppend`/`EuiFormPrepend` styling ([#9305](elastic/eui#9305)) - Updated `EuiFormAppend`/`EuiFormPrepend` to inherit `isDisabled` state from `EuiFormControlLayout` ([#9305](elastic/eui#9305)) - Updated `EuiFormControlLayout` hover, disabled and readonly styling ([#9305](elastic/eui#9305)) - Updated `EuiFormControlButton` to inherit `isDisabled`, `readOnly` and `isInvalid` states from `EuiFormControlLayout` ([#9305](elastic/eui#9305)) - Added `iconSide` prop on `EuiDatePickerRange` ([#9305](elastic/eui#9305)) - Updated `EuiSuperDatePicker` valid state styling ([#9305](elastic/eui#9305)) - Removed background color transition on `EuiButtonEmpty` (other button variants don't have a transition anymore either) ([#9305](elastic/eui#9305)) - Added `isLoading` prop on `EuiFormControlButton` ([#9328](elastic/eui#9328)) - Updated paddings for `EuiButton`, `EuiButtonEmpty`, `EuiFilterButton` ([#8948](elastic/eui#8948)) - Updated paddings for `append`/`prepend` on `EuiFormControlLayout` ([#8948](elastic/eui#8948)) - Added optional `scrollContainerRef` prop to `EuiFlyoutBody` for accessing the flyout's internal scroll container. ([#9373](elastic/eui#9373)) **Bug fixes** - Updated `EuiColorPicker` to ensure `id` is correctly passed onto the internal `EuiFormControlLayout` ([#9014](elastic/eui#9014)) **Breaking changes** - Removed `ink` and `ghost` theme tokens. Use `textInk` / `textGhost` for text and icon colors or `plainDark` /`plainLight` for non-text use cases. ([#9379](elastic/eui#9379)) - Updated `EuiQuickSelectPopover` in `EuiSuperDatePicker` to use `EuiFormPrepend`. This results in more restricted `buttonProps` as they reflect `EuiFormPrepend` instead of generic `EuiButtonEmpty` props. ([#9014](elastic/eui#9014)) - Removed `components.superDatePickerBackgroundSuccees` token ([#9305](elastic/eui#9305)) ### `@elastic/eui-theme-borealis` v6.0.0 - Added `textInk` and `textGhost` color tokens for text and icon colors that should always remain dark or light regardless of color mode. ([#9379](elastic/eui#9379)) ### `@elastic/eslint-plugin-eui` v2.9.0 - Prevented `badge-accessibility-rules` rule autofix from duplicating `aria-hidden` attributes. ([#9366](elastic/eui#9366)) - Skip `badge-accessibility-rules` rule validation when a spread operator is used in a component. ([#9366](elastic/eui#9366)) --------- Co-authored-by: Weronika Olejniczak <weronika.olejniczak@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>



Summary
Important
This PR merges into a feature branch.
closes https://github.com/elastic/platform-ux-team/issues/749
This PR updates paddings of button components according to design specifications.
Changes
EuiButtonDisplayinternally)m->12pxpaddings->8pxpaddingxs->6pxpadding4pxand2px(xs buttons)4pxpadding on button text content (string content only)EuiButtonEmptyandEuiButtonIcon) inside formappend/prependto align with the expected padding and sizingEuiFilterButtonpadding between content to4pxto align with base buttonsImportant
The changes to button padding affect their usage visually in form append/prepend elements.
There is an additional issue to implement the new, stricter API for single-content/action API for append/prepend usages which will replace custom input in the future and ensure a more cohesive look.
With this following update we generally want to start a migration of append/prepend usages and we'll stop advertising custom content usages.
Deployment
The changes have been deployed here:
Why are we making this change?
Implementing a design change to balance spacing in buttons with different content (icons, text etc) and align paddings across different usages (e.g. buttons and form append/prepend).
Screenshots #
EuiButtonScreen.Recording.2025-08-06.at.18.39.51.mov
EuiFilterButtonScreen.Recording.2025-08-06.at.17.06.41.mov
append/prependonEuiFormControlLayoutScreen.Recording.2025-08-07.at.14.17.29.mov
Impact to users
Consumer implementations should be reviewed to find potential visual issues.
QA
Stories:
Steps:
General checklist
Checked in both light and dark modesChecked in both MacOS and Windows high contrast modesChecked for accessibility including keyboard-only and screenreader modesAdded documentationProps have proper autodocs (using@defaultif default values are missing) and playground togglesChecked Code Sandbox works for any docs examplesAdded or updated jest and cypress testsIf applicable, added the breaking change issue label (and filled out the breaking change checklist)If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)