|
14 | 14 | @use 'igniteui-theming/sass/typography/presets' as presets;
|
15 | 15 | @use 'igniteui-theming/sass/typography/charts' as *;
|
16 | 16 |
|
| 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 | + |
17 | 43 | /// Adds typography styles for h1-h6, paragraph and creates custom typography class selectors.
|
18 | 44 | /// The produces styles are based on the passed typeface and type scale.
|
19 | 45 | /// If omitted the $material-typeface and $material-type-scale will be used.
|
|
26 | 52 | $type-scale: presets.$material-type-scale,
|
27 | 53 | $exclude: null
|
28 | 54 | ) {
|
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', '&'); |
50 | 56 |
|
51 |
| - @if ($variant == 'indigo') { |
52 |
| - @include indigo.typography(); |
53 |
| - } |
54 |
| - } |
| 57 | + #{$_scope} { |
| 58 | + @include _component-typography($type-scale, $exclude); |
55 | 59 | }
|
56 | 60 |
|
57 | 61 | @if not(list.index($exclude, 'global')) {
|
|
0 commit comments