Skip to content

Commit dbc750a

Browse files
committed
fix(themes): scoped typography doesn't update component type categories
Closes #12634
1 parent 3b8ece3 commit dbc750a

File tree

1 file changed

+29
-25
lines changed

1 file changed

+29
-25
lines changed

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

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,32 @@
1414
@use 'igniteui-theming/sass/typography/presets' as presets;
1515
@use 'igniteui-theming/sass/typography/charts' as *;
1616

17+
@mixin _component-typography($type-scale, $exclude) {
18+
font-family: var(--ig-font-family);
19+
20+
$variant: map.get(map.get($type-scale, '_meta'), 'variant');
21+
22+
@if not(list.index($exclude, 'charts')) {
23+
@include charts-typography($type-scale);
24+
}
25+
26+
@if ($variant == 'material' or $variant == null) {
27+
@include material.typography();
28+
}
29+
30+
@if ($variant == 'bootstrap') {
31+
@include bootstrap.typography($type-scale);
32+
}
33+
34+
@if ($variant == 'fluent') {
35+
@include fluent.typography();
36+
}
37+
38+
@if ($variant == 'indigo') {
39+
@include indigo.typography();
40+
}
41+
}
42+
1743
/// Adds typography styles for h1-h6, paragraph and creates custom typography class selectors.
1844
/// The produces styles are based on the passed typeface and type scale.
1945
/// If omitted the $material-typeface and $material-type-scale will be used.
@@ -26,32 +52,10 @@
2652
$type-scale: presets.$material-type-scale,
2753
$exclude: null
2854
) {
29-
$variant: map.get(map.get($type-scale, '_meta'), 'variant');
30-
31-
@if is-root() {
32-
.ig-typography {
33-
font-family: var(--ig-font-family);
34-
35-
@if not(list.index($exclude, 'charts')) {
36-
@include charts-typography($type-scale);
37-
}
38-
39-
@if ($variant == 'material' or $variant == null) {
40-
@include material.typography();
41-
}
42-
43-
@if ($variant == 'bootstrap') {
44-
@include bootstrap.typography($type-scale);
45-
}
46-
47-
@if ($variant == 'fluent') {
48-
@include fluent.typography();
49-
}
55+
$_scope: if(is-root() or is-host(), '.ig-typography', '&');
5056

51-
@if ($variant == 'indigo') {
52-
@include indigo.typography();
53-
}
54-
}
57+
#{$_scope} {
58+
@include _component-typography($type-scale, $exclude);
5559
}
5660

5761
@if not(list.index($exclude, 'global')) {

0 commit comments

Comments
 (0)