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

fix(material-experimental/mdc-button): fix positioning of icons in text buttons #20963

Merged
merged 2 commits into from
Nov 13, 2020

Conversation

mmalerba
Copy link
Contributor

@mmalerba mmalerba commented Nov 3, 2020

Here's how it looks with the fix:
fixed icon position

@mmalerba mmalerba added P2 The issue is important to a large percentage of users, with a workaround G This is is related to a Google internal issue target: patch This PR is targeted for the next patch release labels Nov 3, 2020
@mmalerba mmalerba requested a review from jelbourn November 3, 2020 20:17
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 3, 2020
@mmalerba mmalerba changed the title fix(material-experimental/mdc-button): fix positioning of icons in text fix(material-experimental/mdc-button): fix positioning of icons in text buttons Nov 3, 2020
// will extend the `mdc-button__icon` styling to the mat icon. Note that
// the extended styles inherently only match icons that nest themselves in
// a parent `mdc-button`.
.mat-icon {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be constrained to only mat-icon inside of mat-icon-button?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We seem to have an identical issue in the FAB. I've submitted #20969 to address it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I may have copy/pasted this from fab 😅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still looks like this needs to be changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, forgot to push

<button mat-stroked-button>
<mat-icon>home</mat-icon>
with icons
<mat-icon iconPositionEnd>favorite</mat-icon>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the selector be prefixed with mat?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pre-existing API, I'm just using it in this demo

src/material-experimental/mdc-button/button.scss Outdated Show resolved Hide resolved
@mmalerba
Copy link
Contributor Author

mmalerba commented Nov 5, 2020

Comments addressed

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mmalerba mmalerba added the action: merge The PR is ready for merge by the caretaker label Nov 6, 2020
@mmalerba mmalerba added target: patch This PR is targeted for the next patch release and removed target: patch This PR is targeted for the next patch release labels Nov 10, 2020
@mmalerba mmalerba merged commit 933e1e3 into angular:master Nov 13, 2020
mmalerba added a commit that referenced this pull request Nov 13, 2020
…xt buttons (#20963)

* fix(material-experimental/mdc-button): fix positioning of icons in text
buttons

* fixup! fix(material-experimental/mdc-button): fix positioning of icons in text buttons

(cherry picked from commit 933e1e3)
@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 Dec 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement G This is is related to a Google internal issue P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants