Skip to content

fix(button): ensure icons are aligned vertically. #1736

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

Merged
merged 1 commit into from
Nov 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/lib/button/_button-base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,16 @@ $md-mini-fab-padding: 8px !default;
@mixin md-fab($size, $padding) {
@extend %md-raised-button;

// Reset the min-width from the button base.
min-width: 0;

border-radius: $md-fab-border-radius;
width: $size;
height: $size;
padding: 0;

flex-shrink: 0;

i, md-icon {
padding: $padding 0;
line-height: $md-icon-button-line-height;
Expand Down
13 changes: 8 additions & 5 deletions src/lib/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,26 @@
}

[md-icon-button] {
min-width: 0;
padding: 0;

// Reset the min-width from the button base.
min-width: 0;

width: $md-icon-button-size;
height: $md-icon-button-size;

line-height: $md-icon-button-line-height;
flex-shrink: 0;

line-height: $md-icon-button-size;
border-radius: $md-icon-button-border-radius;

.md-button-wrapper > * {
i, md-icon {
line-height: $md-icon-button-line-height;
vertical-align: middle;
}
}

// The text and icon should be vertical aligned inside a button
[md-button], [md-raised-button] {
[md-button], [md-raised-button], [md-icon-button] {
.md-button-wrapper > * {
vertical-align: middle;
}
Expand Down