Fix Dart Sass deprecation warnings
- Replace color.red/green/blue() with color.channel() in styles.scss - Replace deprecated if() ternary with @if/@else in _variants.scss - Silence @import deprecation in angular.json (Bootstrap 5.x uses @import throughout; migrating to @use breaks the variable override mechanism)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
@use 'sass:map';
|
||||
@use 'sass:meta';
|
||||
@use '@angular/material' as mat;
|
||||
@use "sass:map";
|
||||
@use "sass:meta";
|
||||
@use "@angular/material" as mat;
|
||||
|
||||
$_ripple-opacity: 0.1;
|
||||
|
||||
@@ -42,8 +42,11 @@ $_ripple-opacity: 0.1;
|
||||
&.mat-#{"" + $variant} {
|
||||
#{$property}: mat.m2-get-color-from-palette($variant-palette, $hue);
|
||||
&.mat-mdc-button-disabled {
|
||||
$palette: if($property == 'color', $foreground, $background);
|
||||
#{$property}: mat.m2-get-color-from-palette($palette, disabled-button);
|
||||
@if $property == "color" {
|
||||
#{$property}: mat.m2-get-color-from-palette($foreground, disabled-button);
|
||||
} @else {
|
||||
#{$property}: mat.m2-get-color-from-palette($background, disabled-button);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,13 +58,13 @@ $_ripple-opacity: 0.1;
|
||||
$background: map.get($config, background);
|
||||
|
||||
.mat-icon:not(:disabled) {
|
||||
@include _theme-property($config, 'color', text, $variants);
|
||||
@include _theme-property($config, "color", text, $variants);
|
||||
}
|
||||
|
||||
.mdc-button:not(:disabled),
|
||||
.mat-mdc-icon-button:not(:disabled),
|
||||
.mat-mdc-stroked-button:not(:disabled) {
|
||||
@include _theme-property($config, 'color', text, $variants);
|
||||
@include _theme-property($config, "color", text, $variants);
|
||||
@include _focus-overlay-color($config, $variants);
|
||||
}
|
||||
|
||||
@@ -70,8 +73,8 @@ $_ripple-opacity: 0.1;
|
||||
.mat-mdc-unelevated-button:not(:disabled),
|
||||
.mat-mdc-fab:not(:disabled),
|
||||
.mat-mdc-mini-fab:not(:disabled) {
|
||||
@include _theme-property($config, 'color', default-contrast, $variants);
|
||||
@include _theme-property($config, 'background-color', default, $variants);
|
||||
@include _theme-property($config, "color", default-contrast, $variants);
|
||||
@include _theme-property($config, "background-color", default, $variants);
|
||||
@include _ripple-color($config, default-contrast, $_ripple-opacity, $variants);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user