-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[Tabs] Improve color management #24286
Comments
@tkondrashov Do you have a visual example of what you are trying to achieve? The opacity is used to distinguish between selected and unselected tab. I think that we could do two things:
|
@oliviertassinari There were two concerns in my particular case:
In the examples in the docs, some of them avoid this issue (intentionally or not) by giving the Tabs a transparent background and having them on an AppBar with a solid background, but as it isn't a requirement to use Tabs with an AppBar it feels like a workaround even heavier than the opacity adjustment in the theme. What I don't really understand about the need to distinguish tabs is that's what the ink bar is already for, isn't it? |
@tkondrashov Thanks for the visual illustration, perfect, it's a confirmation of #24286 (comment). In your design, the text of the selected tab is Do you want to work on it? |
@oliviertassinari That screenshot was a demonstration of the problems I encountered without the opacity override, so ideally all of them would be |
@tkondrashov ah, right, thanks for the clarification. Contributions welcome! |
@oliviertassinari I'd like to work on this issue since it's been more than a month. |
@Dripcoding You can go ahead 🟢 |
Tabs by default receive the
MuiTab-textColorInherit
class, which for some reason sets their opacity to .7. Honestly I don't know what I'm missing, it's not in the docs but nobody on the internet seems to have complained about this. I can't imagine why this was included except to discourage developers from using inherit, in which case shouldn't it just be removed, or at least an opt-in behavior instead of a default? It's been in the code for 3 years but I can't wrap my mind around the decision here. At risk of stating the obvious, I expected that Tabs using inherited colors would be colored with the colors they inherited, and not mixed with 30% of the colors behind them. I'm forced to add an opacity rule to my theme for tabs if I want the obvious behavior, and figure out on my own why the colors are wrong given that it doesn't appear to be documented.What you need to put in your theme overrides to fix this in case other people find this:
The text was updated successfully, but these errors were encountered: