Material: md-icon inside md-button doesn't get text color

Created on 24 Apr 2015  路  7Comments  路  Source: angular/material

When inserting an md-icon inside and md-button without md-raised class, to make a button with icon and text, the md-icon doesn't take the same color as text. Causing a very fuzzy button to display.

http://plnkr.co/edit/lbvK84KZHYYzLshoRxiB?p=preview

In the previous version (0.8.x) this worked.

fixed

Most helpful comment

@MustafaASK, yes I later figured it out and updated the CSS. Check the plunker

All 7 comments

Just use <md-icon md-svg-src="icon.svg" style=" color: rgb(244,67,54)"></md-icon>

Why I should put inline style for color when the work should be done by the theme?
Using the md-raised or md-fab classes the md-icon color work is manageb by theme as I intend.
http://plnkr.co/edit/rEW16IwZpHRL4ChoYtem?p=preview
Then why without it should not in a normal button, forcing me to write inline style rules?

@davide-quix - Thanks for the follow-up question. While you can easily override and set the color, I agree that the icon should inherit the parent's color (unless explicitly overridden at the Icon or SVG levels).

Please how can I change both md-icon inside md-button with the button text to have the same color when I hover on it. Please see example on plunker

Hi FrederickE, Did you find solution for this problem? We are facing the same issue and have no solution as yet. :(.

@MustafaASK, yes I later figured it out and updated the CSS. Check the plunker

Thanks a ton, FrederickE. This made my day!

Was this page helpful?
0 / 5 - 0 ratings