Skip to content

Commit

Permalink
fix(button): set vertical alignment for md-button and md-raised-button (
Browse files Browse the repository at this point in the history
#1565)

* Set vertical alignment for md-button and md-raised-button so md-icon inside is correctly aligned
  • Loading branch information
tinayuangao authored and jelbourn committed Oct 26, 2016
1 parent c63b9f4 commit f10ac7c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/demo-app/button/button-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,16 @@
<a href="http://www.google.com" md-raised-button color="primary">SEARCH</a>
<button md-raised-button>DANCE</button>
</section>
<section>
<button md-raised-button>More<md-icon>more_vert</md-icon></button>
<button md-raised-button>Check<md-icon>check</md-icon></button>
<button md-raised-button>Check<md-icon class="md-24">favorite</md-icon></button>
<button md-raised-button>Last<md-icon>navigate_before</md-icon></button>
</section>
<section>
<button md-button>More<md-icon>more_vert</md-icon></button>
<button md-button>Check<md-icon>check</md-icon></button>
<button md-button>Check<md-icon class="md-24">favorite</md-icon></button>
<button md-button>Last<md-icon>navigate_before</md-icon></button>
</section>
</div>
7 changes: 7 additions & 0 deletions src/lib/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
}
}

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

// The ripple container should match the bounds of the entire button.
.md-button-ripple {
position: absolute;
Expand Down

0 comments on commit f10ac7c

Please sign in to comment.