Skip to content

Commit

Permalink
fix(core): pill alignment (#255)
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 ac01bd4 commit 1e0fa2f
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/pill/pill.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ $chip-height: 1.25rem;

:host {
display: inline-flex;
width: fit-content;
position: relative;
align-items: center;
justify-content: center;
Expand All @@ -42,4 +43,9 @@ $chip-height: 1.25rem;
.slot {
@include ellipsis;
}

.hidden {
width: 0px;
margin-right: 0px;
}
}
11 changes: 8 additions & 3 deletions packages/core/src/components/pill/pill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,14 @@ export class Pill {
}
title={this.el.textContent}
>
{this.icon ? (
<ix-icon class={'with-icon'} name={this.icon} size={'16'} />
) : null}
<ix-icon
class={{
'with-icon': true,
hidden: this.icon === undefined || this.icon === '',
}}
name={this.icon}
size={'16'}
/>
<div class="slot">
<slot></slot>
</div>
Expand Down

0 comments on commit 1e0fa2f

Please sign in to comment.