Skip to content

Commit

Permalink
fix(core): chip alignment (#259)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Leroux <daniel.leroux@siemens.com>
  • Loading branch information
goncalosard and danielleroux committed Jan 13, 2023
1 parent 1e0fa2f commit 1b490dd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/core/src/components/chip/chip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $border-radius: 100px;

:host {
display: inline-flex;
width: fit-content;
position: relative;
align-items: center;
border-radius: $border-radius;
Expand All @@ -29,6 +30,11 @@ $border-radius: 100px;
margin-right: $tiny-space;
}

.hidden {
width: 0px;
margin-right: 0px;
}

margin-left: $tiny-space;

.close-button-container {
Expand Down
11 changes: 8 additions & 3 deletions packages/core/src/components/chip/chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,14 @@ export class Chip {
: {}
}
>
{this.icon ? (
<ix-icon class={'with-icon'} name={this.icon} size={'24'} />
) : null}
<ix-icon
class={{
'with-icon': true,
hidden: this.icon === undefined || this.icon === '',
}}
name={this.icon}
size={'24'}
/>
<span class="slot-container">
<slot></slot>
</span>
Expand Down

0 comments on commit 1b490dd

Please sign in to comment.