angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.23k stars 6.7k forks source link

matCardTitle overridden by h2 styles #10215

Open calebegg opened 6 years ago

calebegg commented 6 years ago

https://stackblitz.com/edit/angular-material2-issue-wjytux?file=app/app.component.html

I'd like to change my <mat-card-title> into <h2 matCardTitle>, for screenreader accessibility. But that overrides the styling. I think the styling for matCardTitle needs to be higher specificity.

(I can't use aria-level because it's not widely supported).

jelbourn commented 6 years ago

.mat-typography h2 is indeed overriding the card-title's specificity.

jelbourn commented 3 years ago

@crisbeto looking through older issues- it seems like for this one we should probably make sure we have the behavior we want for MDC-based card and let that be the fix. Thoughts?

crisbeto commented 3 years ago

Sure, but I think that we'll need a similar fix to #10217 for the MDC card, because it has the same specificity issue.

jelbourn commented 3 years ago

Yeah, I meant just fixing it exclusively for mdc card and not worrying about the pre-mdc version.