Skip to content

Commit ba22e4a

Browse files
committed
fix(badge): fix badge paddings and update API docs
1 parent 266c781 commit ba22e4a

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

projects/igniteui-angular/badge/src/badge/badge.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ export class IgxBadgeComponent {
7777
* Sets/gets the value to be displayed inside the badge.
7878
*
7979
* @remarks
80-
* If an `icon` property is already set the `icon` will be displayed.
8180
* If neither a `value` nor an `icon` is set the content of the badge will be empty.
8281
*
8382
* @example
@@ -92,7 +91,6 @@ export class IgxBadgeComponent {
9291
* Sets/gets an icon for the badge from the material icons set.
9392
*
9493
* @remarks
95-
* Has priority over the `value` property.
9694
* If neither a `value` nor an `icon` is set the content of the badge will be empty.
9795
* Providing an invalid value won't display anything.
9896
*

projects/igniteui-angular/core/src/core/styles/components/badge/_badge-theme.scss

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
border-radius: calc(var(--size) / 2);
2727
box-shadow: var-get($theme, 'elevation');
2828
overflow: hidden;
29+
padding-inline: pad-inline(rem(4px), rem(6px), if($variant == 'indigo', rem(6px), rem(8px)));
2930

30-
&:not(:has(igx-icon)) {
31-
padding-inline: pad-inline(rem(4px), rem(6px), if($variant == 'indigo', rem(6px), rem(8px)));
31+
&:has(igx-icon:only-child) {
32+
padding-inline: 0;
3233
}
3334

3435
igx-icon {
@@ -105,10 +106,7 @@
105106

106107
min-width: var(--_dot-size);
107108
min-height: var(--_dot-size);
108-
109-
&:not(:has(igx-icon)) {
110-
padding: 0;
111-
}
109+
padding: 0;
112110

113111
igx-icon,
114112
> * {

0 commit comments

Comments
 (0)