Skip to content

Commit 53b56e1

Browse files
authored
Merge pull request #14001 from IgniteUI/sivanova/badge-typography
feat(badge): implement typography
2 parents 98b0f0e + dc393cc commit 53b56e1

File tree

6 files changed

+28
-9
lines changed

6 files changed

+28
-9
lines changed

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,7 @@
103103
align-items: center;
104104
min-width: var(--_badge-size);
105105
min-height: var(--_badge-size);
106-
font-size: calc(var(--_badge-size) / 2);
107-
font-weight: $badge-font-weight;
108106
color: var-get($theme, 'text-color');
109-
line-height: 1;
110107
background: var-get($theme, 'background-color');
111108
border-radius: calc(var(--size) / 2);
112109
box-shadow: var-get($theme, 'shadow');
@@ -126,10 +123,6 @@
126123
}
127124

128125
@if $variant == 'indigo-design' {
129-
font-size: rem(11px);
130-
line-height: rem(15px);
131-
font-weight: 700;
132-
133126
igx-icon {
134127
$icon-size: rem(12px);
135128

@@ -168,3 +161,17 @@
168161
visibility: hidden;
169162
}
170163
}
164+
165+
/// Adds typography styles for the igx-badge component.
166+
/// Uses the 'caption' category from the typographic scale.
167+
/// @group typography
168+
/// @param {Map} $categories [(text: 'caption')] - The categories from the typographic scale used for type styles.
169+
@mixin badge-typography($categories: (text: 'caption')) {
170+
$text: map.get($categories, 'text');
171+
172+
%igx-badge-display {
173+
@include type-style($text) {
174+
margin: 0;
175+
}
176+
}
177+
}

projects/igniteui-angular/src/lib/core/styles/components/input/_input-group-theme.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,8 +1454,10 @@
14541454
padding-inline: pad-inline(rem(2px), rem(4px), rem(6px));
14551455
}
14561456

1457-
%form-group-input--search {
1458-
padding-inline: pad-inline(rem(6px), rem(8px), rem(10px));
1457+
@if $variant == 'indigo-design' {
1458+
%form-group-input--search {
1459+
padding-inline: pad-inline(rem(6px), rem(8px), rem(10px));
1460+
}
14591461
}
14601462

14611463
%indigo--box-focused {

projects/igniteui-angular/src/lib/core/styles/typography/_bootstrap.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@use 'sass:map';
2+
@use '../components/badge/badge-theme' as *;
23
@use '../components/banner/banner-theme' as *;
34
@use '../components/bottom-nav/bottom-nav-theme' as *;
45
@use '../components/button/button-theme' as *;
@@ -33,6 +34,7 @@
3334
@mixin typography($type-scale) {
3435
$calendar-labels: map.get($type-scale, 'calendar-labels');
3536

37+
@include badge-typography();
3638
@include banner-typography();
3739
@include bottom-nav-typography();
3840
@include button-typography();

projects/igniteui-angular/src/lib/core/styles/typography/_fluent.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use '../components/badge/badge-theme' as *;
12
@use '../components/banner/banner-theme' as *;
23
@use '../components/bottom-nav/bottom-nav-theme' as *;
34
@use '../components/button/button-theme' as *;
@@ -30,6 +31,7 @@
3031
@use '../components/tree/tree-theme' as *;
3132

3233
@mixin typography() {
34+
@include badge-typography();
3335
@include banner-typography($categories: (
3436
message: 'caption'
3537
));

projects/igniteui-angular/src/lib/core/styles/typography/_indigo.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use '../components/badge/badge-theme' as *;
12
@use '../components/banner/banner-theme' as *;
23
@use '../components/bottom-nav/bottom-nav-theme' as *;
34
@use '../components/button/button-theme' as *;
@@ -30,6 +31,9 @@
3031
@use '../components/tree/tree-theme' as *;
3132

3233
@mixin typography() {
34+
@include badge-typography($categories: (
35+
text: 'button',
36+
));
3337
@include banner-typography();
3438
@include bottom-nav-typography();
3539
@include button-typography();

projects/igniteui-angular/src/lib/core/styles/typography/_material.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use '../components/badge/badge-theme' as *;
12
@use '../components/banner/banner-theme' as *;
23
@use '../components/bottom-nav/bottom-nav-theme' as *;
34
@use '../components/button/button-theme' as *;
@@ -30,6 +31,7 @@
3031
@use '../components/tree/tree-theme' as *;
3132

3233
@mixin typography() {
34+
@include badge-typography();
3335
@include banner-typography();
3436
@include bottom-nav-typography();
3537
@include button-typography();

0 commit comments

Comments
 (0)