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:
2026-04-26 07:32:15 +02:00
parent e12bbf29ae
commit 9be9f191bb
3 changed files with 19 additions and 14 deletions
+12 -9
View File
@@ -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);
}
}