Skip to content

Commit 7a840a7

Browse files
authored
refactor(themes): include --ig-theme in the generated CSS themes (#14508)
1 parent cf7d2bb commit 7a840a7

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

projects/igniteui-angular/src/lib/core/styles/themes/generators/_base.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@use 'sass:list';
2+
@use 'sass:map';
23
@use 'sass:meta';
34
@use 'sass:string';
45
@use '../schemas' as *;
@@ -72,6 +73,8 @@
7273
// Stores all excluded component styles
7374
$excluded: ();
7475
$scope: if(is-root(), ':root', '&');
76+
$theme: map.get($schema, '_meta', 'theme');
77+
$variant: map.get($schema, '_meta', 'variant');
7578

7679
#{$scope} {
7780
--ig-size-small: 1;
@@ -111,6 +114,13 @@
111114
}
112115
}
113116

117+
@if $theme {
118+
#{$scope} {
119+
--ig-theme: #{if($theme == 'indigo-design', 'indigo', #{$theme})};
120+
--ig-theme-variant: #{$variant};
121+
}
122+
}
123+
114124
@if list.length($exclude) > 0 {
115125
$excluded: is-component($exclude);
116126
}

src/app/input-group/input-group.sample.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@
285285
<igx-hint>Helper text</igx-hint>
286286
</igx-input-group>
287287

288-
<igx-input-group [type]="inputType" theme="indigo-design">
288+
<igx-input-group [type]="inputType" theme="indigo">
289289
<label igxLabel>Always Indigo</label>
290290
<igx-prefix>
291291
http://

src/styles/_variables.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ $typeface: $material-typeface;
77
$type-scale: $material-type-scale;
88
$variant: map.get($schema, '_meta', 'variant');
99

10-
:root {
11-
--ig-theme: material;
12-
}
13-
1410
$background-color: var(--ig-gray-900-contrast);
1511
$foreground-color: hsl(var(--ig-gray-900));
1612

0 commit comments

Comments
 (0)