Skip to content

Commit d47477f

Browse files
authored
Merge pull request #6806 from IgniteUI/CSS-variables-default-#6803
refactor(theme): change legacy support default value to false
2 parents 1e798ec + eb0bafe commit d47477f

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes for each version of this project will be documented in this
44

55
## 9.1.0
66

7+
### Themes
8+
- **Breaking Change** Change the default `$legacy-support` value to false in the `igx-theme` function.
9+
710
### New Features
811

912
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`

projects/igniteui-angular/src/lib/core/styles/base/utilities/_functions.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@
350350
/// // otherwise, it will return the value for key 'icon-color' in the '$avatar-theme';
351351
/// @returns {String} - The value of the key in the passed map, or the name of key concatenated with the key name.
352352
@function --var($map, $key, $fallback: null) {
353-
$igx-legacy-support: if(global-variable-exists('igx-legacy-support'), $igx-legacy-support, true);
353+
$igx-legacy-support: if(global-variable-exists('igx-legacy-support'), $igx-legacy-support, false);
354354

355355
@if map-has-key($map, $key) {
356356
@if $igx-legacy-support == false {

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

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
/// @param {Map} $palette - An igx-palette to be used by the global theme.
5252
/// @param {Map} $schema [$light-schema] - The schema used as basis for styling the components.
5353
/// @param {List} $exclude [( )] - A list of igx components to be excluded from the global theme styles.
54-
/// @param {Boolean} $legacy-support - Turn off support for IE11, allowing you to use css variables to style components.
54+
/// @param {Boolean} $legacy-support [false] - If set to true, it turns on support for IE11, i.e. css variables are not used in the generated component themes.
5555
/// @param {Boolean} $elevation [true] - Turns on/off elevations for all components in the theme.
5656
/// @param {Number} $roundness [null] - Sets the global roundness factor (the value can be any decimal fraction between 0 and 1) for all components.
5757
/// @requires {variable} $components
@@ -91,7 +91,7 @@
9191
$palette,
9292
$schema: $light-schema,
9393
$exclude: (),
94-
$legacy-support: true,
94+
$legacy-support: false,
9595
$roundness: null,
9696
$elevation: true,
9797
) {
@@ -412,11 +412,11 @@
412412
/// Creates a global theme that can be used with light backgrounds.
413413
/// @param {Map} $palette - An igx-palette to be used by the global theme.
414414
/// @param {List} $exclude [( )] - A list of igx components to be excluded from the global theme styles.
415-
/// @param {Boolean} $legacy-support - Turn off support for IE11, allowing you to use css variables to style components.
415+
/// @param {Boolean} $legacy-support [false] - If set to true, it turns on support for IE11, i.e. css variables are not used in the generated component themes.
416416
@mixin igx-light-theme(
417417
$palette,
418418
$exclude: (),
419-
$legacy-support: true,
419+
$legacy-support: false,
420420
$roundness: null,
421421
$elevation: true,
422422
) {
@@ -447,11 +447,11 @@
447447
/// Creates a global theme that can be used with dark backgrounds.
448448
/// @param {Map} $palette - An igx-palette to be used by the global theme.
449449
/// @param {List} $exclude [( )] - A list of igx components to be excluded from the global theme styles.
450-
/// @param {Boolean} $legacy-support - Turn off support for IE11, allowing you to use css variables to style components.
450+
/// @param {Boolean} $legacy-support [false] - If set to true, it turns on support for IE11, i.e. css variables are not used in the generated component themes.
451451
@mixin igx-dark-theme(
452452
$palette,
453453
$exclude: (),
454-
$legacy-support: true,
454+
$legacy-support: false,
455455
$roundness: null,
456456
$elevation: true,
457457
) {
@@ -482,11 +482,11 @@
482482
/// Creates a global fluent theme that can be used with light backgrounds.
483483
/// @param {Map} $palette - An igx-palette to be used by the global theme.
484484
/// @param {List} $exclude [( )] - A list of igx components to be excluded from the global theme styles.
485-
/// @param {Boolean} $legacy-support - Turn off support for IE11, allowing you to use css variables to style components.
485+
/// @param {Boolean} $legacy-support [false] - If set to true, it turns on support for IE11, i.e. css variables are not used in the generated component themes.
486486
@mixin igx-fluent-theme(
487487
$palette,
488488
$exclude: (),
489-
$legacy-support: true,
489+
$legacy-support: false,
490490
$roundness: null,
491491
$elevation: true,
492492
) {
@@ -517,11 +517,11 @@
517517
/// Creates a global fluent theme that can be used with dark backgrounds.
518518
/// @param {Map} $palette - An igx-palette to be used by the global theme.
519519
/// @param {List} $exclude [( )] - A list of igx components to be excluded from the global theme styles.
520-
/// @param {Boolean} $legacy-support - Turn off support for IE11, allowing you to use css variables to style components.
520+
/// @param {Boolean} $legacy-support [false] - If set to true, it turns on support for IE11, i.e. css variables are not used in the generated component themes.
521521
@mixin igx-fluent-dark-theme(
522522
$palette,
523523
$exclude: (),
524-
$legacy-support: true,
524+
$legacy-support: false,
525525
$roundness: null,
526526
$elevation: true,
527527
) {
@@ -553,11 +553,11 @@
553553
/// Creates a global bootstrap-like theme that can be used with light backgrounds.
554554
/// @param {Map} $palette - An igx-palette to be used by the global theme.
555555
/// @param {List} $exclude [( )] - A list of igx components to be excluded from the global theme styles.
556-
/// @param {Boolean} $legacy-support - Turn off support for IE11, allowing you to use css variables to style components.
556+
/// @param {Boolean} $legacy-support [false] - If set to true, it turns on support for IE11, i.e. css variables are not used in the generated component themes.
557557
@mixin igx-bootstrap-theme(
558558
$palette,
559559
$exclude: (),
560-
$legacy-support: true,
560+
$legacy-support: false,
561561
$roundness: null,
562562
$elevation: true,
563563
) {
@@ -615,11 +615,11 @@
615615
/// Creates a global bootstrap-like theme that can be used with dark backgrounds.
616616
/// @param {Map} $palette - An igx-palette to be used by the global theme.
617617
/// @param {List} $exclude [( )] - A list of igx components to be excluded from the global theme styles.
618-
/// @param {Boolean} $legacy-support - Turn off support for IE11, allowing you to use css variables to style components.
618+
/// @param {Boolean} $legacy-support [false] - If set to true, it turns on support for IE11, i.e. css variables are not used in the generated component themes.
619619
@mixin igx-bootstrap-dark-theme(
620620
$palette,
621621
$exclude: (),
622-
$legacy-support: true,
622+
$legacy-support: false,
623623
$roundness: null,
624624
$elevation: true,
625625
) {
@@ -667,4 +667,3 @@
667667
$elevation: $elevation,
668668
);
669669
}
670-

projects/igniteui-angular/src/lib/services/overlay/overlay.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2601,7 +2601,7 @@ describe('igxOverlay', () => {
26012601
const overlayWrapper = document.getElementsByClassName(CLASS_OVERLAY_WRAPPER_MODAL)[0];
26022602
tick();
26032603
const styles = css(overlayWrapper);
2604-
const expectedBackgroundColor = 'background: rgba(0, 0, 0, 0.38)';
2604+
const expectedBackgroundColor = 'background: var(--igx-overlay-background-color)';
26052605
const appliedBackgroundStyles = styles[2];
26062606
expect(appliedBackgroundStyles).toContain(expectedBackgroundColor);
26072607
}));

0 commit comments

Comments
 (0)