Skip to content
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

Align FontIcon inside Button component #1958

Closed
tarmolov opened this issue Oct 21, 2015 · 12 comments
Closed

Align FontIcon inside Button component #1958

tarmolov opened this issue Oct 21, 2015 · 12 comments
Labels
new feature New feature or request

Comments

@tarmolov
Copy link

At documentation page the icon is accurately align to the left side of the button. But it looks different in my demo.

Code:

<RaisedButton label='Sign in with Github'>
    <FontIcon className="muidocs-icon-custom-github"/>
</RaisedButton>

Styles:

<link href="http://material-ui.com/css/main.css" rel="stylesheet" type="text/css">

I included this css file because I wanted to get the same icon as in doc page. It is just for test.

Of course I can do style inlining for the button and fix the issue. But it doesn't look good for me.

How to align icons inside buttons properly?

@c0b41
Copy link

c0b41 commented Oct 21, 2015

material ui not need css file?

@etmarch
Copy link

etmarch commented Oct 22, 2015

+1. I tried both "before" and "after" for the labelPosition property, but nothing changed.

@tarmolov
Copy link
Author

material ui not need css file?

I included css file from material-ui.com because of using muidocs-icon-custom-github classname. I wanted to reproduce button view exactly as it looks at material-ui.com.

I'll update my post. Thx.

@oliviertassinari
Copy link
Member

This partialy solve the issue #2014. We still have before and after option that are inversed.

@ACPK
Copy link

ACPK commented Nov 11, 2015

+1 for centering the icon.

@RahavLussato
Copy link
Contributor

+1

@mccxiv
Copy link

mccxiv commented Dec 7, 2015

My very first experience with this library: broken buttons

@oliviertassinari
Copy link
Member

@subjectix I think that the up coming v0.14 is the right moment to fix this (introduce a small breaking change).

@oliviertassinari
Copy link
Member

@mccxiv You are right, the issue is that the demo components are altered by the documentation. We are moving each demo into an isolated component, this will be fixed and shouldn't happnend again.

@alitaheri
Copy link
Member

@oliviertassinari Yes I agree. any clue how to solve this? I'm clueless 😬

@alitaheri alitaheri added the new feature New feature or request label Dec 9, 2015
@zachguo
Copy link
Contributor

zachguo commented Jan 7, 2016

I aligned my FontIcon in Button by <FontIcon style={verticalAlign: 'middle', lineHeight: '36px'} ... />

36px is the line height of parent element (here Button)

@oliviertassinari
Copy link
Member

#2874 Is partially solving the issue.
We still have a wrong default value for the labelPostion. We should change it for the next breaking changes release: v0.15.0.

mnajdova pushed a commit to mnajdova/material-ui that referenced this issue Nov 10, 2020
Bumps [notistack](https://github.com/iamhosseindhv/notistack) from 0.9.11 to 0.9.17.
- [Release notes](https://github.com/iamhosseindhv/notistack/releases)
- [Changelog](https://github.com/iamhosseindhv/notistack/blob/master/CHANGELOG.md)
- [Commits](iamhosseindhv/notistack@v0.9.11...v0.9.17)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants