-
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
fix(dialog): not applying margins to new button variants #11961
Conversation
src/lib/button/button.ts
Outdated
// Add a class that applies to all buttons. This makes it easier to target if somebody | ||
// wants to target all Material buttons. We do it here rather than `host` to ensure that | ||
// the class is applied to derived classes. | ||
elementRef.nativeElement.classList.add('mat-button-base'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding another class of mat-button-base
, can we just always have mat-button
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to have a new class, since people could potentially be depending on certain variants not having .mat-button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/lib/button/button.ts
Outdated
// Add a class that applies to all buttons. This makes it easier to target if somebody | ||
// wants to target all Material buttons. We do it here rather than `host` to ensure that | ||
// the class is applied to derived classes. | ||
elementRef.nativeElement.classList.add('mat-button-base'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to have a new class, since people could potentially be depending on certain variants not having .mat-button
Hi @crisbeto! This PR has merge conflicts due to recent upstream merges. |
b3d1cee
to
ace24a8
Compare
Reworks the button focus indication and ripples so that they render behind the text of the button, instead of top of it. This helps with the contrast ratios while focused. Incorporates some of the changes from angular#11961 so that we don't have to increase the size of the CSS selectors.
Reworks the button focus indication and ripples so that they render behind the text of the button, instead of top of it. This helps with the contrast ratios while focused. Also gets rid of the `mat-button-focus-overlay` element in favor of using `::before` which saves us the extra DOM node. Incorporates some of the changes from angular#11961 so that we don't have to increase the size of the CSS selectors.
A while ago we introduced a few new button variants, however we never updated the button selector in the dialog which means that they won't get the proper margin if they're placed next to each other. With the new variants, the dialog selector will grow exponentially since we have to list every possible button combination, which is why I added a new class to the button which makes it a lot easier to target any button.
ace24a8
to
fbd4ebc
Compare
Reworks the button focus indication and ripples so that they render behind the text of the button, instead of top of it. This helps with the contrast ratios while focused. Also gets rid of the `mat-button-focus-overlay` element in favor of using `::before` which saves us the extra DOM node. Incorporates some of the changes from #11961 so that we don't have to increase the size of the CSS selectors.
Reworks the button focus indication and ripples so that they render behind the text of the button, instead of top of it. This helps with the contrast ratios while focused. Also gets rid of the `mat-button-focus-overlay` element in favor of using `::before` which saves us the extra DOM node. Incorporates some of the changes from #11961 so that we don't have to increase the size of the CSS selectors.
Setting as a P2, because it keeps coming up in bug reports. |
A while ago we introduced a few new button variants, however we never updated the button selector in the dialog which means that they won't get the proper margin if they're placed next to each other. With the new variants, the dialog selector will grow exponentially since we have to list every possible button combination, which is why I added a new class to the button which makes it a lot easier to target any button. (cherry picked from commit 66fa26f)
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. |
A while ago we introduced a few new button variants, however we never updated the button selector in the dialog which means that they won't get the proper margin if they're placed next to each other. With the new variants, the dialog selector will grow exponentially since we have to list every possible button combination, which is why I added a new class to the button which makes it a lot easier to target any button.
Note: if we consider that this new class won't be very useful and that it's bleeding dialog logic into the button module, I can rework it so it's the dialog that applies a special class to all buttons.