-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
mat-card-flat SCSS class not working #11014
Comments
That's because the styles for the card seem to be overriding the |
Exactly, I just don't have any idea on how to fix it. |
Fixes the `.mat-flat-card` selector not working due to its specificity being too low. Fixes angular#11014.
Fixes the `.mat-flat-card` selector not working due to its specificity being too low. Fixes angular#11014.
I'd like to suggest a import { Directive, ElementRef } from '@angular/core';
@Directive({
selector: 'mat-card[matCardFlat]',
exportAs: 'matCardFlat'
})
export class MatCardFlatDirective {
constructor(elRef: ElementRef) {
const el: HTMLElement = elRef.nativeElement;
el.classList.add('mat-card-flat', 'mat-elevation-z0');
}
} Where |
Fixes the `.mat-flat-card` selector not working due to its specificity being too low. Fixes #11014.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
bug
What is the expected behavior?
.mat-card-flat
class to make a card look flatten.What is the current behavior?
So many shadows.
What are the steps to reproduce?
https://stackblitz.com/edit/angular-material2-issue-ercan7?file=app/app.component.html
What is the use-case or motivation for changing an existing behavior?
The class is there and it's not working.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Material >= 5 <= 6
Is there anything else we should know?
The class
.mat-elevation-z
works, that's because a rule in;https://github.com/angular/material2/blob/21d004a4322df944539458281e1983965cfb6edd/src/lib/core/style/_elevation.scss#L151
...I think.
The text was updated successfully, but these errors were encountered: