Skip to content

Commit 125fe10

Browse files
authored
Merge pull request #7785 from IgniteUI/simeonoff/fix-7783-10.0.x
fix(typography): incorrectly compiled custom typography styles
2 parents 1419ff3 + 61d2e3f commit 125fe10

File tree

1 file changed

+38
-42
lines changed

1 file changed

+38
-42
lines changed

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

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -45,48 +45,6 @@
4545
-webkit-font-smoothing: antialiased;
4646
-moz-osx-font-smoothing: grayscale;
4747

48-
$this: bem--selector-to-string(&);
49-
$selector: bem--extract-first-selector($this);
50-
51-
// Maps type scale typographic categories
52-
// to native elements.
53-
$category-element-map: (
54-
h1: 'h1',
55-
h2: 'h2',
56-
h3: 'h3',
57-
h4: 'h4',
58-
h5: 'h5',
59-
h6: 'h6',
60-
body-1: 'p'
61-
);
62-
63-
@each $category, $type-style in $type-scale {
64-
// Get the native element that uses typographic styles directly
65-
// as mapped in the $category-element-map
66-
$e: map-get($category-element-map, $category);
67-
68-
// Create a placeholder selector with styles for each
69-
// typographic style to be able to easily extend it
70-
// elsewhere.
71-
%#{$category} {
72-
@include igx-type-style($type-scale, $category);
73-
}
74-
75-
// Add native element typographic styles.
76-
@if $e != null {
77-
#{$e} {
78-
@extend %#{$category};
79-
}
80-
}
81-
82-
// Add class selector typographic styles.
83-
@if ($selector == '.igx-typography') {
84-
@include e(#{$category}) {
85-
@extend %#{$category};
86-
}
87-
}
88-
}
89-
9048
// Call the individual component styles with the type scale
9149
@include _excel-filtering-typography($type-scale);
9250
@include igx-banner-typography($type-scale);
@@ -138,6 +96,44 @@
13896
// and all typographic elements.
13997
@include b(igx-typography) {
14098
@include _igx-typography-styles($font-family, $type-scale);
99+
100+
// Maps type scale typographic categories
101+
// to native elements.
102+
$category-element-map: (
103+
h1: 'h1',
104+
h2: 'h2',
105+
h3: 'h3',
106+
h4: 'h4',
107+
h5: 'h5',
108+
h6: 'h6',
109+
body-1: 'p'
110+
);
111+
112+
@each $category, $type-style in $type-scale {
113+
// Get the native element that uses typographic styles directly
114+
// as mapped in the $category-element-map
115+
$e: map-get($category-element-map, $category);
116+
117+
// Create a placeholder selector with styles for each
118+
// typographic style to be able to easily extend it
119+
// elsewhere.
120+
%#{$category} {
121+
@include igx-type-style($type-scale, $category);
122+
}
123+
124+
// Add native element typographic styles.
125+
@if $e != null {
126+
// stylelint-disable-next-line max-nesting-depth
127+
#{$e} {
128+
@extend %#{$category};
129+
}
130+
}
131+
132+
// Add class selector typographic styles.
133+
@include e(#{$category}) {
134+
@extend %#{$category};
135+
}
136+
}
141137
}
142138
} @else {
143139
@include _igx-typography-styles($font-family, $type-scale);

0 commit comments

Comments
 (0)