Skip to content

Commit f10ac7c

Browse files
tinayuangaojelbourn
authored andcommitted
fix(button): set vertical alignment for md-button and md-raised-button (#1565)
* Set vertical alignment for md-button and md-raised-button so md-icon inside is correctly aligned
1 parent c63b9f4 commit f10ac7c

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/demo-app/button/button-demo.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,16 @@
8989
<a href="http://www.google.com" md-raised-button color="primary">SEARCH</a>
9090
<button md-raised-button>DANCE</button>
9191
</section>
92+
<section>
93+
<button md-raised-button>More<md-icon>more_vert</md-icon></button>
94+
<button md-raised-button>Check<md-icon>check</md-icon></button>
95+
<button md-raised-button>Check<md-icon class="md-24">favorite</md-icon></button>
96+
<button md-raised-button>Last<md-icon>navigate_before</md-icon></button>
97+
</section>
98+
<section>
99+
<button md-button>More<md-icon>more_vert</md-icon></button>
100+
<button md-button>Check<md-icon>check</md-icon></button>
101+
<button md-button>Check<md-icon class="md-24">favorite</md-icon></button>
102+
<button md-button>Last<md-icon>navigate_before</md-icon></button>
103+
</section>
92104
</div>

src/lib/button/button.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@
4747
}
4848
}
4949

50+
// The text and icon should be vertical aligned inside a button
51+
[md-button], [md-raised-button] {
52+
.md-button-wrapper > * {
53+
vertical-align: middle;
54+
}
55+
}
56+
5057
// The ripple container should match the bounds of the entire button.
5158
.md-button-ripple {
5259
position: absolute;

0 commit comments

Comments
 (0)