I'm using the Callemall react material-ui dependency within a meteor app. I am wondering how I can change the color and height of the AppBar I'm using. Is this possible by using inline styles to override the theme variables? If so, how?
injectTapEventPlugin();
var {AppBar} = MUI;
var {ThemeManager, LightRawTheme} = Styles;
Header = React.createClass({
childContextTypes: {
muiTheme: React.PropTypes.object
},
getChildContext() {
return {
muiTheme: ThemeManager.getMuiTheme(LightRawTheme);
}
;
},
render: function () {
return (
<AppCanvas>
<AppBar iconElementLeft={
<div className="header-left-area">
<FloatingActionButton
title="Register"
iconClassName="muidocs-icon-action-grade"
secondary={true}
mini={true}/>
</div>
}/>
</AppCanvas>
);
}
});
Best Answer
You might want to stay away from the
inline style
prop. See this.We have Material UI v1.0 now.
Material UI v1.0
You have many options to do this - look at the implementation code to understand how it works.
If this is your theme
You have many options, here are 2:
1 Use the default color you just coded
AppBar will be white
#fff
.2 Or Inherit the color from
palette.background.appBar
AppBar will be black
#000
.