Skip to content

Commit 0875ca1

Browse files
authored
refactor(progress): update typography styles (#14377)
1 parent e736535 commit 0875ca1

File tree

6 files changed

+73
-27
lines changed

6 files changed

+73
-27
lines changed

projects/igniteui-angular/src/lib/core/styles/components/progress/_progress-theme.scss

Lines changed: 55 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108

109109
$bar-height: map.get((
110110
material: rem(4px),
111-
fluent: rem(4px),
111+
fluent: rem(2px),
112112
bootstrap: rem(16px),
113113
indigo-design: rem(4px),
114114
), $variant);
@@ -148,6 +148,8 @@
148148

149149
@if $variant == 'indigo-design' {
150150
gap: rem(4px);
151+
} @else if $variant == 'fluent' {
152+
gap: rem(2px);
151153
}
152154

153155
&[dir='rtl'],
@@ -257,13 +259,6 @@
257259
%linear-value {
258260
margin: $value-margin;
259261
color: var-get($theme, 'text-color');
260-
font-size: $value-fs;
261-
font-weight: $value-fw;
262-
263-
@if $variant == 'indigo-design' {
264-
font-size: rem(12px);
265-
line-height: rem(16px);
266-
}
267262
}
268263

269264
%linear-value--start {
@@ -384,6 +379,20 @@
384379
}
385380
}
386381

382+
/// Adds typography styles for the igx-linear-bar component.
383+
/// Uses the 'subtitle-2' category from the typographic scale.
384+
/// @group typography
385+
/// @param {Map} $categories [(value: 'subtitle-2')] - The categories from the typographic scale used for type styles.
386+
@mixin linear-bar-typography($categories: (value: 'subtitle-2')) {
387+
$value: map.get($categories, 'value');
388+
389+
%linear-value {
390+
@include type-style($value) {
391+
margin: 0;
392+
}
393+
}
394+
}
395+
387396
/// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
388397
///
389398
/// @param {Color} $base-circle-color [null] - The base circle fill color.
@@ -454,25 +463,27 @@
454463

455464
$variant: map.get($theme, '_meta', 'variant');
456465

466+
$circular-size: map.get((
467+
material: rem(32px),
468+
fluent: rem(32px),
469+
bootstrap: rem(54px),
470+
indigo-design: rem(48px),
471+
), $variant);
472+
457473
$stroke-width: map.get((
458474
material: rem(4px),
459475
fluent: rem(4px),
460-
bootstrap: rem(8px),
476+
bootstrap: rem(4px),
461477
indigo-design: rem(4px),
462478
), $variant);
463479

464480
%circular-display {
465481
display: inline-flex;
466482
flex: 1 1 auto;
467-
width: rem(32px);
468-
height: rem(32px);
483+
width: $circular-size;
484+
height: $circular-size;
469485
position: relative;
470486

471-
@if $variant == 'indigo-design' {
472-
width: rem(48px);
473-
height: rem(48px);
474-
}
475-
476487
svg {
477488
width: 100%;
478489
height: 100%;
@@ -506,6 +517,10 @@
506517
@if $variant == 'indigo-design' {
507518
stroke-width: calc($stroke-width + rem(1px));
508519
}
520+
521+
@if $variant == 'material' {
522+
stroke-width: calc($stroke-width + rem(2px));
523+
}
509524
}
510525

511526
%circular-outer--indeterminate {
@@ -522,16 +537,8 @@
522537
inset-block-start: 50%;
523538
inset-inline-start: 50%;
524539
transform: translate(-50%, -50%);
525-
font-size: rem(16px);
526-
line-height: 1;
527540
text-align: center;
528-
font-weight: 600;
529541
color: var-get($theme, 'text-color');
530-
531-
@if $variant == 'indigo-design' {
532-
font-size: rem(12px);
533-
line-height: rem(16px);
534-
}
535542
}
536543

537544
%circular-text--hidden {
@@ -557,3 +564,27 @@
557564
}
558565
}
559566
}
567+
568+
// Adds typography styles for the igx-circular-bar component.
569+
/// Uses custom typography
570+
/// @group typography
571+
/// @param {Map} $categories [(text: 'h6')] - The categories from the typographic scale used for type styles.
572+
@mixin circular-bar-typography($categories: (text: 'h6')) {
573+
$text: map.get($categories, 'text');
574+
575+
@if $text != null {
576+
%circular-text {
577+
@include type-style($text) {
578+
font-size: rem(12px);
579+
line-height: rem(16px);
580+
margin: 0;
581+
}
582+
}
583+
} @else {
584+
%circular-text {
585+
font-size: rem(12px);
586+
font-weight: 700;
587+
line-height: rem(16px);
588+
}
589+
}
590+
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
@use '../components/list/list-theme' as *;
2121
@use '../components/navbar/navbar-theme' as *;
2222
@use '../components/navdrawer/navdrawer-theme' as *;
23+
@use '../components/progress/progress-theme' as *;
2324
@use '../components/radio/radio-theme' as *;
2425
@use '../components/slider/slider-theme' as *;
2526
@use '../components/snackbar/snackbar-theme' as *;
@@ -54,6 +55,9 @@
5455
label: 'body-1',
5556
));
5657
@include chip-typography();
58+
@include circular-bar-typography($categories: (
59+
text: 'subtitle-1'
60+
));
5761
@include column-actions-typography();
5862
@include date-range-typography();
5963
@include dialog-typography($categories: (
@@ -77,6 +81,7 @@
7781
helper-text: 'body-2',
7882
input-text: 'body-1'
7983
));
84+
@include linear-bar-typography();
8085
@include list-typography($categories: (
8186
item: 'body-2',
8287
title: 'body-1',

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
@use '../components/list/list-theme' as *;
2020
@use '../components/navbar/navbar-theme' as *;
2121
@use '../components/navdrawer/navdrawer-theme' as *;
22+
@use '../components/progress/progress-theme' as *;
2223
@use '../components/radio/radio-theme' as *;
2324
@use '../components/slider/slider-theme' as *;
2425
@use '../components/snackbar/snackbar-theme' as *;
@@ -57,6 +58,9 @@
5758
@include chip-typography($categories: (
5859
text: 'subtitle-2'
5960
));
61+
@include circular-bar-typography($categories: (
62+
text: null
63+
));
6064
@include column-actions-typography();
6165
@include date-range-typography();
6266
@include dialog-typography();
@@ -73,6 +77,7 @@
7377
helper-text: 'caption',
7478
input-text: 'body-2'
7579
));
80+
@include linear-bar-typography();
7681
@include list-typography($categories: (
7782
header: 'overline',
7883
item: 'caption',

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
@use '../components/list/list-theme' as *;
2020
@use '../components/navbar/navbar-theme' as *;
2121
@use '../components/navdrawer/navdrawer-theme' as *;
22+
@use '../components/progress/progress-theme' as *;
2223
@use '../components/radio/radio-theme' as *;
2324
@use '../components/slider/slider-theme' as *;
2425
@use '../components/snackbar/snackbar-theme' as *;
@@ -56,6 +57,9 @@
5657
label: 'body-2',
5758
));
5859
@include chip-typography();
60+
@include circular-bar-typography($categories: (
61+
text: 'subtitle-2'
62+
));
5963
@include column-actions-typography();
6064
@include date-range-typography();
6165
@include dialog-typography($categories: (
@@ -75,6 +79,7 @@
7579
helper-text: 'caption',
7680
input-text: 'body-2'
7781
));
82+
@include linear-bar-typography();
7883
@include list-typography($categories: (
7984
header: 'overline',
8085
item: 'body-2',

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
@use '../components/list/list-theme' as *;
2020
@use '../components/navbar/navbar-theme' as *;
2121
@use '../components/navdrawer/navdrawer-theme' as *;
22+
@use '../components/progress/progress-theme' as *;
2223
@use '../components/radio/radio-theme' as *;
2324
@use '../components/slider/slider-theme' as *;
2425
@use '../components/snackbar/snackbar-theme' as *;
@@ -40,6 +41,7 @@
4041
@include card-typography();
4142
@include checkbox-typography();
4243
@include chip-typography();
44+
@include circular-bar-typography();
4345
@include column-actions-typography();
4446
@include date-range-typography();
4547
@include dialog-typography();
@@ -49,6 +51,7 @@
4951
@include excel-filtering-typography();
5052
@include icon-button-typography();
5153
@include input-group-typography();
54+
@include linear-bar-typography();
5255
@include list-typography();
5356
@include navbar-typography();
5457
@include navdrawer-typography();

src/app/progressbar/progressbar.sample.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ <h4 class="sample-title">Circular progress indicator</h4>
7474
</div>
7575
</div>
7676
<div class="circular-samples">
77-
<div class="circular-container">
78-
<igx-circular-bar class="circular-sample" [value]="43"></igx-circular-bar>
79-
</div>
8077
<div class="circular-container">
8178
<igx-circular-bar class="circular-sample" [value]="53"></igx-circular-bar>
8279
</div>

0 commit comments

Comments
 (0)