-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
fontSize style not applied on FontIcon inside a IconButton #4718
Comments
I found this looking for something else but I think I can answer your question. If you take a look at the docs for const styles = {
smallIcon: {
width: 36,
height: 36,
},
small: {
width: 72,
height: 72,
padding: 16,
},
};
const IconButtonExampleSize = () => (
<div>
<IconButton
iconStyle={styles.smallIcon}
style={styles.small}>
<ActionHome />
</IconButton>
</div>
); |
@caseychoiniere This will works only for SVG icons but not for Font icons. |
+1, this is quite frustrating! Thanks tho' for the amazing job. |
Looks like we can close this issue |
Has it been fixed? |
I am still having the issue with react |
@aahan96 Please re-open this issue since it's not already fixed. |
The docs themselves at http://www.material-ui.com/#/components/raised-button list the following code: import FontIcon from 'material-ui/FontIcon';
<RaisedButton
href="https://github.com/callemall/material-ui"
target="_blank"
secondary={true}
icon={<FontIcon className="muidocs-icon-custom-github" />}
style={style}
/> And yet it doesn't work and there's nothing explaining how to get it to work. The |
Including the font css then makes it work with Basically, the way the docs describe it, this should be super easy and require no extra work, yet there are several threads about this spanning years that have people in it who are completely lost! |
@aahan96 not fixed. Reopen issues, plz. |
Also voting to reopen the issue. For now I copied the FontIcon component and referenced it in my own project rather than
|
Not sure why this was ever closed. @aahan96? Preaching to the choir, but - the best way to get an issue fixed is (after discussing your approach) to submit a PR. |
I still agree that FontIcon's style prop should still be the ideal way to set the FontIcon's style inside of a IconButton, however we were able to get the FontIcon size working properly on our project like this: <IconButton
onTouchTap={this.handleTouchTap}
iconStyle={{fontSize: '18px'}}>
<FontIcon className="fa fa-filter" color={accentBlue}/>
</IconButton> Material-UI v0.18.0 |
Thank you @jgreubel! That workaround is rather simple and gets the job done. |
We have been porting the component on the v1-beta branch. We reimplemented it from the ground-up. While we haven't tested it, I think that the issue is most likely fixed on that branch. Hence, I'm closing it. |
Problem description
Hello everyone.
I have encountered a problem applying fontSize style on FontIcon. FontIcon is inside a IconButton.
The icon size is still the default size (24).
Steps to reproduce
Versions
The text was updated successfully, but these errors were encountered: