-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(mdButton): icon vertical alignment #8194
Conversation
@devversion - can you review/test ? |
See the notes on the issue for how to test it easily. On Sunday, April 24, 2016, Thomas Burleson [email protected] wrote:
Best regards, Website: freightchick.com |
@@ -145,6 +145,11 @@ button.md-button::-moz-focus-inner { | |||
&.ng-hide, &.ng-leave { | |||
transition: none; | |||
} | |||
|
|||
md-icon { | |||
// Fixes icon vertical alignment. |
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 this comment is actually not saying really much.
Can we explain more, why this is needed and for example, which components are affected by the vertical alignment problem?
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.
@devversion Agreed. I'll see if I can figure out why it actually fixes it. iirc layout="row"
has a rule to have all children use display: block;
.
So I did some digging, and the icon alignment issue was actually introduced way back in The default browser alignment for buttons doesn't appear to use any css properties and is just something specific to buttons. I couldn't find any info about this around the web or in the spec for buttons. It's using some hidden builtin method for vertical alignment, instead of a regular css property. I'll update my comment shortly. |
Note I also just tested this with |
👍 |
@ivoviz In the original issue I was thinking to add it for It does in fact break the layout in a couple cases. I original checked that Here is a demo with all the combos of button/a href and the different classes. |
Here is an updated demo that's working across all cases. Using this rule
I'll update my pr to include this. |
@epelc Yup, this new one seems to work, thanks! |
@epelc Just wanted to let you know, that I'll test the PR tomorrow. |
I'm sorry that I didn't test it until now. Issues are sometimes getting lost. I just checked your PR out and compared with the latest demos. Some calculations:
So the correct top offset (
Since this is actually testable, we should add this as a unit test, because we're able to execute those calculations on Headless browsers as well. Once the Test is there, LGTM. |
I applied the display change to
.md-button md-icon
because regular buttons with icons and fab buttons also require this fix.This fixes
md-icon
vertical alignment withinmd-button
. Closes #8066