Skip to content

Commit 23cedc1

Browse files
crisbetotinayuangao
authored andcommitted
build: fix sass compilation error (#10806)
Fixes the following SASS error due to a top-level ampersand selector: ``` Error in plugin 'sass' Message: src\lib\core\_core.scss Error: Base-level rules cannot contain the parent-selector-referencing character '&'. on line 43 of src/lib/core/_core.scss, in mixin `mat-core-theme` from line 39 of src/lib/core/theming/_all-theme.scss, in mixin `angular-material-theme` from line 14 of src/lib/core/theming/prebuilt/deeppurple-amber.scss >> &.mat-app-background { --^ ```
1 parent 51206ee commit 23cedc1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/core/_core.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
@include mat-optgroup-theme($theme);
3838
@include mat-pseudo-checkbox-theme($theme);
3939

40-
// Wrapper element that provides the theme background when the
41-
// user's content isn't inside of a `mat-sidenav-container`.
42-
.mat-app-background,
43-
&.mat-app-background {
40+
// Wrapper element that provides the theme background when the user's content isn't
41+
// inside of a `mat-sidenav-container`. Note that we need to exclude the ampersand
42+
// selector in case the mixin is included at the top level.
43+
.mat-app-background#{if(&, ', &.mat-app-background', '')} {
4444
$background: map-get($theme, background);
4545
$foreground: map-get($theme, foreground);
4646

0 commit comments

Comments
 (0)