-
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
md-icon is not rendered correctly in md-button #1454
Comments
I found this as well. I made due in the mean time by setting |
I have the same problem with version "v2.0.0-alpha.8-2". Could you put an example of your workaround @emilio-martinez? Thanks |
I found a workaround for this issue in my case (row with "center center" alignment):
|
An easier option (adding style="vertical-align:middle;")
|
@denislamela exactly. Vertical align does the trick. That said, some icons shift a bit, so |
The question here is "which is the right component for a button containing both text and an icon?", and then we need to make sure that it behaves as expected. |
I actually figured out a way (especially for md-raised-button, since for an non md-raised-button the icon and the text alignments are OK). All you have to do is to wrap the
Also to provide a bit of distance between the text and the icon, I added Note: For convenience, I have used the same CSS
And the button HTML markup looks like the following:
|
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?
The Icon in md-icon should be aligned horizontally centered when it is used in a md-raised-button.
What is the current behavior?
When I have a md-icon in a md-raised-button the icon is rendered at the top of the button and not in the center like the normal text is.
What are the steps to reproduce?
<button md-raised-button">Last<md-icon>navigate_before</md-icon></button>
Like you can see the icon is rendered very weird.
Which versions of Angular, Material, OS, browsers are affected?
Angular: 2.0.1
Angular Material: 2.0.0-alpha.9-3
Angular-CLI: 1.0.0-beta.15
Tested in Chrome and Firefox on Ubuntu 16.04
The text was updated successfully, but these errors were encountered: