Skip to content

Commit

Permalink
Fix alignment of left icon for OuiListGroupItem with multiline text (o…
Browse files Browse the repository at this point in the history
…pensearch-project#1000)

Signed-off-by: Danila Gulderov <[email protected]>
  • Loading branch information
gulderov committed Sep 8, 2023
1 parent 8531d2a commit 8f97381
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Fix blurry text in breadcrumbs by avoiding skewing text ([#959](https://github.com/opensearch-project/oui/pull/959))
- Remove `calc` usage from SchemaItem styles ([#990](https://github.com/opensearch-project/oui/pull/990))
- Add support for null types when deriving JSON from Sass variables ([#1019](https://github.com/opensearch-project/oui/pull/1019))
- Fix alignment of left icon for OuiListGroupItem with multiline text

### 🚞 Infrastructure

Expand Down
7 changes: 7 additions & 0 deletions src-docs/src/views/list_group/list_group_extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,12 @@ export default () => (
wrapText
label="Fourth very, very long item with wrapping enabled that will not force truncation"
/>

<OuiListGroupItem
iconType={'package'}
onClick={() => {}}
wrapText
label="Fifth very long item with wrapping enabled and icon included"
/>
</OuiListGroup>
);
13 changes: 13 additions & 0 deletions src/components/list_group/_list_group_item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
}
}

.ouiListGroupItem__icon {
height: $ouiSizeL;
}

.ouiListGroupItem-isActive:not(.ouiListGroupItem--ghost) & {
color: $ouiTextColor;
}
Expand All @@ -117,6 +121,7 @@
}

.ouiListGroupItem__icon {
align-self: flex-start;
margin-right: $ouiSizeM;
flex-grow: 0;
flex-shrink: 0;
Expand All @@ -140,13 +145,21 @@
.ouiListGroupItem__text {
line-height: $ouiSize;
}

.ouiListGroupItem__icon {
height: $ouiSize;
}
}

.ouiListGroupItem--large {
.ouiListGroupItem__button,
.ouiListGroupItem__text {
line-height: $ouiSizeXL;
}

.ouiListGroupItem__icon {
height: $ouiSizeXL;
}
}

.ouiListGroupItem--wrapText {
Expand Down

0 comments on commit 8f97381

Please sign in to comment.