Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile sass because of mat-badge-theme mixin error #9990

Closed
tcober opened this issue Feb 16, 2018 · 1 comment · Fixed by #9991
Closed

Can't compile sass because of mat-badge-theme mixin error #9990

tcober opened this issue Feb 16, 2018 · 1 comment · Fixed by #9991
Assignees
Labels
P4 A relatively minor issue that is not relevant to core functions

Comments

@tcober
Copy link

tcober commented Feb 16, 2018

Bug, feature request, or proposal:

Bug

What is the expected behavior?

My sass would compile.

What is the current behavior?

I get the error:
"Error: Base-level rules cannot contain the parent-selector-referencing character '&'.\A on line 2890 of phsapp/node_modules/@angular/material/_theming.scss, in mat-badge-theme'\A from line 2973 of phsapp/node_modules/@angular/material/_theming.scss, in angular-material-theme'\A from line 27 of sass/theme/material/olo-theme.scss"

What are the steps to reproduce?

Using this custom theming file

@import '../../../phsapp/node_modules/@angular/material/theming';
    $cdk-z-index-overlay-container: 99999;
    $cdk-z-index-overlay: 99999;
    $cdk-z-index-overlay-backdrop: 99999;
    // Plus imports for other components in your app.
    // Include the common styles for Angular Material. We include this here so that you only
    // have to load a single css file for Angular Material in your app.
    // Be sure that you only ever include this mixin once!
    $OLOtype: mat-typography-config( $font-family: inherit, $headline: mat-typography-level(32px, 48px, 700), $body-1: mat-typography-level(16px, 24px, 500));
    @include mat-core($OLOtype);
    $mat-oloblue: ( 50: #e3edf6, 100: #b8d2e9, 200: #89b4da, 300: #5995cb, 400: #367fbf, 500: #1268b4, 600: #1060ad, 700: #0d55a4, 800: #0a4b9c, 900: #053a8c, A100: #b9d0ff, A200: hsl(220, 100%, 76%), A400: #538bff, A700: #3a7aff, contrast: ( 50: #000000, 100: #000000, 200: #000000, 300: #000000, 400: #ffffff, 500: #ffffff, 600: #ffffff, 700: #ffffff, 800: #ffffff, 900: #ffffff, A100: #000000, A200: #000000, A400: #000000, A700: #ffffff, ));
    $mat-olopurple: ( 50: #efe0ec, 100: #d8b3cf, 200: #be80b0, 300: #a34d90, 400: #902678, 500: #7c0060, 600: #740058, 700: #69004e, 800: #5f0044, 900: #4c0033, A100: #ff80cc, A200: #ff4db8, A400: #ff1aa3, A700: #ff0099, contrast: ( 50: #000000, 100: #000000, 200: #000000, 300: #ffffff, 400: #ffffff, 500: #ffffff, 600: #ffffff, 700: #ffffff, 800: #ffffff, 900: #ffffff, A100: #000000, A200: #000000, A400: #ffffff, A700: #ffffff, ));
    $mat-olowarning: ( 50: #fae2e9, 100: #f2b8c7, 200: #e988a2, 300: #e0587d, 400: #da3561, 500: #d31145, 600: #ce0f3e, 700: #c80c36, 800: #c20a2e, 900: #b7051f, A100: #ffe1e4, A200: #ffaeb6, A400: #ff7b88, A700: #ff6271, contrast: ( 50: #000000, 100: #000000, 200: #000000, 300: #000000, 400: #ffffff, 500: #ffffff, 600: #ffffff, 700: #ffffff, 800: #ffffff, 900: #ffffff, A100: #000000, A200: #000000, A400: #000000, A700: #000000, ));
    // Define the palettes for your theme using the Material Design palettes available in palette.scss
    // (imported above). For each palette, you can optionally specify a default, lighter, and darker
    // hue.
    $OLOprimary: mat-palette($mat-oloblue);
    $OLOaccent: mat-palette($mat-olopurple);
    // The warn palette is optional (defaults to red).
    $OLOwarn: mat-palette($mat-olowarning);
    // Create the theme object (a Sass map containing all of the palettes).
    $OLOtheme: mat-light-theme($OLOprimary, $OLOaccent, $OLOwarn);
    // Include theme styles for core and each component used in your app.
    // Alternatively, you can import and @include the theme mixins for each component
    // that you are using.
    @include mat-core-theme($OLOtheme);
    @include angular-material-theme($OLOtheme);
    @include mat-badge-theme(mat-light-theme($OLOprimary, $OLOaccent, $OLOwarn));
    .mat-icon {
        font-size: 23px!important;
    }

Is there anything else we should know?

If I go into @angular/_theming.scss and remove the ampersands from the mat-badge-theme mixin everything works great.

@crisbeto crisbeto self-assigned this Feb 16, 2018
@crisbeto crisbeto added has pr P4 A relatively minor issue that is not relevant to core functions labels Feb 16, 2018
crisbeto added a commit to crisbeto/material2 that referenced this issue Feb 16, 2018
Fixes the badge theme not compiling in some cases, because it contains a couple of top-level ampersand selectors.

Fixes angular#9990.
jelbourn pushed a commit that referenced this issue Feb 18, 2018
)

Fixes the badge theme not compiling in some cases, because it contains a couple of top-level ampersand selectors.

Fixes #9990.
tinayuangao pushed a commit that referenced this issue Feb 20, 2018
)

Fixes the badge theme not compiling in some cases, because it contains a couple of top-level ampersand selectors.

Fixes #9990.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants