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

[Tab] Make active tab change background color and themable #6271

Closed
mateeyow opened this issue Mar 3, 2017 · 2 comments
Closed

[Tab] Make active tab change background color and themable #6271

mateeyow opened this issue Mar 3, 2017 · 2 comments
Labels
component: tabs This is the name of the generic UI component, not the React module!

Comments

@mateeyow
Copy link

mateeyow commented Mar 3, 2017

Problem description

I want to style my tab to a different background color when it is active. I also want to have it on muiTheme if possible.

Versions

  • Material-UI: Latest
  • React: Latest
  • Browser: All
@oliviertassinari oliviertassinari added the component: tabs This is the name of the generic UI component, not the React module! label May 21, 2017
@acsakshay
Copy link

acsakshay commented Jul 24, 2017

@oliviertassinari, It would have been great if you could add the option to set selectedBackgroundColor in the getMuiThemes.js

Changes that I had to do in order to override the settings for getting the desired result are -

material-ui/styles/getMuiTheme.js
tabs: { backgroundColor: palette.primary1Color, textColor: (0, _colorManipulator.fade)(palette.alternateTextColor, 0.7), selectedTextColor: palette.alternateTextColor, selectedBackgroundColor: palette.primary1Color },

material-ui/Tabs/Tab.js
return { root: { color: props.selected ? tabs.selectedTextColor : tabs.textColor, backgroundColor: props.selected ? tabs.selectedBackgroundColor : tabs.backgroundColor, fontWeight: 500, fontSize: 14, width: props.width, textTransform: 'uppercase', padding: 0 },

const for muiTheme(in app.jsx)
const muiTheme1 = getMuiTheme({ tabs: { backgroundColor: '#FFFFFF', textColor: '#000000', selectedTextColor: '#FFFFFF', selectedBackgroundColor: '#000000', } })

I am not sure if it breaks anything or it affects other settings, please correct me if I am wrong. Also if you can include the setting in you next release it would be of great help for other users as well and not requiring to maintain forked copies.

Thanks a million.

Cheers!

@oliviertassinari
Copy link
Member

The v0.x version is in low maintenance mode. We won't work on it. Please consider upgrading to the v1 versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tabs This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

3 participants