Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
18.1.x
Description
After updating to Angular 18.2.0 in an app using Angular Material with a custom theme, the following Sass warning is produced:
▲ [WARNING] Deprecation [plugin angular-sass]
node_modules/@angular/material/slide-toggle/_slide-toggle-theme.scss:46:6:
46 │ --mdc-switch-disabled-label-text-color: #{inspection.get-the...
╵ ^
$theme,
foreground,
disabled-text
)};
Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.
More info: https://sass-lang.com/d/mixed-decls
The warning originates from the Slide Toggle theme:
Reproduction
StackBlitz link: https://stackblitz.com/edit/tq6jmr?file=src%2Fstyles.scss
Steps to reproduce:
- Build / start the project
Expected Behavior
No Sass warning produced
Actual Behavior
Sass warning is produced
Environment
Angular CLI: 18.2.0
Node: 18.20.3
Package Manager: yarn 1.22.19
OS: linux x64
Angular: 18.2.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, localize, material, material-experimental
... material-moment-adapter, platform-browser
... platform-browser-dynamic, router
Package Version
@angular-devkit/architect 0.1802.0
@angular-devkit/build-angular 18.2.0
@angular-devkit/core 18.2.0
@angular-devkit/schematics 18.2.0
@schematics/angular 18.2.0
rxjs 7.4.0
typescript 5.4.5
zone.js 0.14.6