-
Notifications
You must be signed in to change notification settings - Fork 852
feat(eui): make EuiFormControlLayoutIcons top-aligned #8590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
weronikaolejniczak
wants to merge
7
commits into
elastic:main
from
weronikaolejniczak:8553-euicombobox-clear-button-alignment
Closed
feat(eui): make EuiFormControlLayoutIcons top-aligned #8590
weronikaolejniczak
wants to merge
7
commits into
elastic:main
from
weronikaolejniczak:8553-euicombobox-clear-button-alignment
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7acecae
to
cf2d048
Compare
19c2546
to
eea6cd3
Compare
acstll
reviewed
Apr 15, 2025
packages/eui/src/components/form/form_control_layout/form_control_layout_icons.styles.ts
Show resolved
Hide resolved
mgadewoll
reviewed
Apr 17, 2025
f7a3e8c
to
f600952
Compare
Preview staging links for this PR:
|
f600952
to
8d258b3
Compare
28 tasks
💔 Build Failed
Failed CI StepsHistory
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Relates to #8553
This PR updates the
EuiFormControlLayoutIcons
component to align icons to the top instead of the center. To do this, I apply a calculatedpadding-top
using the formula:(control height - icon size) / 2
. This value is not directly tied tocontrolPadding
orcontrolCompressedPadding
.For the uncompressed variant, the calculated value happens to match
controlPadding
((40px - 16px) / 2 = 12px
), so there's no visual difference. However, for the compressed variant, the correct top padding should be10px
((32px - 12px) / 2 = 10px
) which doesn’t align with the standard 4-based modular scale (where the nearest value would be8px
, the value ofcontrolCompressedPadding
). We want to make it work across themes and theme overrides, so we have to avoid hard-coding values.We have to account for cases where the border is applied to the layout group and the actual control is
x - 2px
. This includes icon position static, append / prepend andEuiFormControlLayoutDelimited
.Instead of fixing this only for
EuiComboBox
, I’ve applied the change globally to all form controls, as suggested in the original issue. See the impact details below.Note
This update should allow us to remove the local style override introduced in Kibana PR #217132.
Additional information
Component overrides
Targeting
.euiFormControlLayoutIcons
class:packages/eui/src/components/date_picker/date_picker_range.styles.ts:79
packages/eui/src/components/date_picker/date_picker.styles.ts:42
packages/eui/src/components/form/text_area/text_area.styles.ts:88
packages/eui-theme-common/src/global_styling/mixins/_form.scss:211
Component impact
eui/packages/eui/src/components/color_picker/color_picker.tsx
eui/packages/eui/src/components/combo_box/combo_box_input/combo_box_input.tsx
eui/packages/eui/src/components/date_picker/date_picker.tsx
eui/packages/eui/src/components/date_picker/date_picker_range.styles.ts
eui/packages/eui/src/components/date_picker/super_date_picker/super_date_picker.tsx
eui/packages/eui/src/components/form/field_number/field_number.tsx
eui/packages/eui/src/components/form/field_password/field_password.tsx
eui/packages/eui/src/components/form/field_search/field_search.tsx
eui/packages/eui/src/components/form/field_text/field_text.tsx
eui/packages/eui/src/components/form/form_control_layout/form_control_layout_delimited.tsx
eui/packages/eui/src/components/form/select/select.tsx
eui/packages/eui/src/components/form/super_select/super_select_control.tsx
eui/packages/eui/src/components/form/text_area/text_area.tsx
QA
General checklist
Checked in both light and dark modesChecked in both MacOS and Windows high contrast modesEdge, and FirefoxChecked for accessibility including keyboard-only and screenreader modesAdded documentationProps have proper autodocs (using@default
if default values are missing) and playground togglesChecked Code Sandbox works for any docs examplesIf 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)Specific checklist
EuiComboBox
with a lot of selected optionscompressed
anduncompressed
variants, bothstatic
andabsolute
icon positions