material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

Icon not showing up

Open leshow opened this issue 10 years ago • 15 comments

I am using the example project, I added an AppBar to main.jsx:

    render() {
        return (
            <div style={containerStyle}>
                <AppBar
                    iconElementRight={ <IconButton iconClassName="muidocs-icon-custom-github" tooltip="GitHub"/> }
                    title="PR-Stat"
                />
                <Dialog
                    actions={standardActions}
                    onRequestClose={this._handleRequestClose}
                    open={this.state.open}
                    title="Super Secret Password"
                >
                    1-2-3-4-5
                </Dialog>
                <h1>material-ui</h1>
                <h2>example project</h2>
                <RaisedButton label="Super Secret Password"
                    primary={true} onTouchTap={this._handleTouchTap} />
            </div>
        );
    },

the muidocs-icon-custom-github icon does not show the github icon. An IconButton with such a class name is described in the docs

leshow avatar Dec 15 '15 03:12 leshow

You are right, the className is from the doc source code: https://github.com/callemall/material-ui/blob/master/docs/src/www/css/font-icons/style.css#L59.

@subjectix We should address this during the migration of the doc to make the examples more standalone.

oliviertassinari avatar Dec 15 '15 11:12 oliviertassinari

@oliviertassinari Yes definitely! :+1:

alitaheri avatar Dec 15 '15 11:12 alitaheri

so... how do I get the icon to show up?

leshow avatar Dec 15 '15 22:12 leshow

@leshow For the FontIcon component, you need to have

.muidocs-icon-custom-github:before {
    content: "\e625";
}

and to import the font

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

oliviertassinari avatar Dec 15 '15 23:12 oliviertassinari

I added that to my main.css and index.html (i'm using the gulp/react example app) and the icon was replaced with the rectangle with an 'X' in it, the icon missing icon. So that still didn't do it. Where are you getting the content CSS from?

leshow avatar Dec 18 '15 02:12 leshow

Ah, nevermind. I was missing some more CSS from that file

leshow avatar Dec 18 '15 02:12 leshow

heeey, this seems to have happened a while back, but I'm having the same issue... The github icon DOES NOT show up :( even after having added that bit of .css into my