Skip to content

Commit

Permalink
fix(elements): align ino-icon vertically (#1379)
Browse files Browse the repository at this point in the history
Closes #1340

## Proposed Changes

- Added `vertical-alignment: middle;` to the ino-icon.
- Adjusted alignment settings for all parent components that are
affected by this change to ensure consistent vertical alignment

Parent components that needed adjustment:
- [x] ino-button
- [x] ino-chip
- [x] ino-icon-button (this also seemed to fix the misaligned ripple
issue that has been reocurring before)
- [x] ino-select

other components like the ino-avatar didnt need any refactoring
  • Loading branch information
TobiasHeimGalindo authored Apr 19, 2024
1 parent 0f72282 commit e7acf68
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ ino-button {
}

.icon__wrapper {
display: inline-flex;
height: 16px;
}

Expand Down
3 changes: 3 additions & 0 deletions packages/elements/src/components/ino-chip/ino-chip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ ino-chip {
transition: ease-in-out 0.15s;

.ino-chip-leading-icon {
display: flex;
justify-content: center;

--ino-icon-width: #{$icon-size};
--ino-icon-height: #{$icon-size};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ ino-icon-button {
background-color: $background-color;
border-radius: 50%;

&__icon {
display: inline-flex;
}

.mdc-icon-button__ripple::before,
.mdc-icon-button__ripple::after {
background-color: $background-active-color;
Expand Down
1 change: 1 addition & 0 deletions packages/elements/src/components/ino-icon/ino-icon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
display: inline-flex;
flex-direction: column;
justify-content: center;
vertical-align: middle;

i {
font-size: inherit;
Expand Down
6 changes: 5 additions & 1 deletion packages/elements/src/components/ino-select/ino-select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ ino-select {
}

.mdc-select__icon {
margin-top: 12px;
margin-top: 6px;
}

.mdc-select__dropdown-icon {
Expand Down Expand Up @@ -170,6 +170,10 @@ ino-select {
margin-top: 16px;
}

.mdc-select__icon {
margin-top: 2px;
}

.mdc-floating-label.mdc-floating-label--float-above {
top: 28px;
}
Expand Down
1 change: 1 addition & 0 deletions packages/storybook/src/stories/ino-button/ino-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#story--buttons-ino-button--leading-and-trailing-icon-inner {
@include story-container {
display: flex;
justify-content: center;
column-gap: 20px;
}
}

0 comments on commit e7acf68

Please sign in to comment.