I am trying to overwrite the Material UI CSS and align the the phone icon and the phone text in the same line and closer to each other. I researched and found Tabs API.
Then I debugged and found the wrapper property was creating a problem. I tried fixing by setting display to block but the phone icon and phone text are still not aligning in same line.
I've provided code and sandbox below. All of my code is in tab-demo.js
https://codesandbox.io/s/7p4ryw691
const styles = theme => ({
root: {
// flexGrow: 1,
width: "100%",
// flex: 0,
textTransform: "capitalize"
// backgroundColor: theme.palette.background.paper
// backgroundColor: 'red'
},
sportsAdvancedSearch: {
// backgroundColor: 'green'
color: "red",
fontSize: 16,
fontWeight: "bold"
},
sportsTotalNumber: {
fontWeight: "bold"
},
sportsExportContainer: {
paddingTop: 8,
paddingBottom: 8
},
indicator: {
backgroundColor: "red"
},
tabsIndicator: {
backgroundColor: "red",
textTransform: "capitalize"
},
tabRoot: {
textTransform: "initial",
width: "100%",
display: "block",
"&:hover": {
color: "red",
opacity: 1,
textTransform: "initial"
},
"&$tabSelected": {
color: "red",
fontWeight: theme.typography.fontWeightMedium,
textTransform: "capitalize"
},
"&:focus": {
color: "red",
textTransform: "capitalize"
}
},
tabSelected: {},
sportsHeading: {
fontSize: 32,
fontWeight: "bold",
padding: 16
},
sportsTabHeader: {
// border: "1px solid red",
backgroundColor: "#f5f5f5"
},
alignment: {
display: "block"
// color: 'red'
}
});
<Tabs
value={value}
onChange={this.handleChange}
scrollable
scrollButtons="on"
classes={{ indicator: classes.tabsIndicator }}
>
<Tab
label="phone"
icon={<PhoneIcon style={{ display: "block" }} />}
classes={{
root: classes.tabRoot,
selected: classes.tabSelected,
wrapper: classes.alignment
}}
/>
<Tab
favorites={favorites}
label="Favorites"
icon={<FavoriteIcon style={{ display: "block" }} />}
classes={{
root: classes.tabRoot,
selected: classes.tabSelected,
wrapper: classes.alignment
}}
/>
</Tabs>