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

FlatButton and RaisedButton overwrite styles on icon (no way to style icons) #4874

Closed
NoHomey opened this issue Aug 2, 2016 · 1 comment
Closed
Labels
component: button This is the name of the generic UI component, not the React module! package: icons Specific to @mui/icons

Comments

@NoHomey
Copy link

NoHomey commented Aug 2, 2016

Problem description

FlatButton and RaisedButton overwrite styles on icon (no way to style icons).

Steps to reproduce

import * as React from 'react';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import Keyboard from 'material-ui/svg-icons/hardware/keyboard';
import FlatButton from 'material-ui/FlatButton';
import { render as ReactDomRender } from 'react-dom';
import * as injectTapEventPlugin from 'react-tap-event-plugin';
const { div, link } = React.DOM;

class Demo extends React.Component {
    render() {
        const icont = React.cloneElement(<Keyboard />, {style: {width: 100, height: 100, color: 'red'}});
        let theme = getMuiTheme();
        theme.button.height = 120;
        theme.button.minWidth = 200;
        return (
            <MuiThemeProvider muiTheme={theme}>
                <div>
                    <link href="https://fonts.googleapis.com/css?family=Roboto:400,300,500" rel="stylesheet" type="text/css"/>
                    {icon}
                    <FlatButton icon={icon} />
                </div>
            </MuiThemeProvider>
        );
    }
}

injectTapEventPlugin();
let bootstrapNode = document.createElement('div');
ReactDomRender(<Demo />, bootstrapNode);
document.body.appendChild(bootstrapNode);

Versions

  • Material-UI: 0.15.2
  • React: 15.2.1
  • Browser: Google Chrome Version 52.0.2743.82 (64-bit)

Description

FlatButton and RaisedButton overwrite styles on icon (no way to style icons).

Images & references

Screenshot

-->

@NoHomey NoHomey changed the title FlatButton icon's size can not be styled FlatButton and RaisedButton overwrite styles on icon (no way to style icons) Aug 2, 2016
@NoHomey
Copy link
Author

NoHomey commented Aug 2, 2016

I started browsing source file and commits and found that this issue is fixed for FlatButtons in #4754 and in #4 for RaisedButton.

@NoHomey NoHomey closed this as completed Aug 2, 2016
@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 21, 2022
@zannager zannager added component: button This is the name of the generic UI component, not the React module! package: icons Specific to @mui/icons and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: button This is the name of the generic UI component, not the React module! package: icons Specific to @mui/icons
Projects
None yet
Development

No branches or pull requests

3 participants