@use '../abstract/variables' as v;
@use '../abstract/theme' as t;
@use '../abstract/mixins' as m;
@use 'config' as c;

$colors: ('primary', 'secondary', 'tertiary', 'success', 'warning', 'info');

@include c.host('badge') {
display: inline-flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
vertical-align: middle;
overflow: hidden;
height: 16px;
min-width: 16px;
max-width: 34px;
padding: 0 4px;
border-radius: v.shape('full');
@include m.typography('label-small');
background-color: t.color('error');
color: t.color('on-error');

@each $color in $colors {
&[color='#{$color}'] {
background-color: t.color($color);
color: t.color('on-#{$color}');
}
}

&:empty[label]:not([label=''])::before {
content: attr(label);
}

&[label='999+'] {
max-width: none;
}

&:not([variant='small']):is(:empty:not([label]), [label=''], [label='0']) {
width: 0;
height: 0;
min-width: 0;
max-width: none;
padding: 0;
font-size: 0;
background-color: transparent;
}

&[variant='small'] {
width: 6px;
height: 6px;
min-width: 6px;
max-width: none;
padding: 0;
font-size: 0;
}
}
