Source:  Twitter logo

A component's color in Material UI can be 'default' | 'inherit' | 'primary' | 'secondary'

What do "default" and "inherit" mean here? Some components' default color is "default", while some's is "inherit". This confuses me more.

I did a lot of search. Can't find the answer.

Here are some materialUI docs that describe it (albiet poorly, not specifically defining what inherit does)

I was not able to specifically find docs describing the behavior, however - all it does is set the color via css inherit, rather than explicitly defining the color. Which is to say, if the component is nested and you defined a specific color on the top level component, inherit will have the sub-component take that color, rather than being the default color.

3 users liked answer #0dislike answer #03
nxSolari profile pic

Copyright © 2022 QueryThreads

All content on Query Threads is licensed under the Creative Commons Attribution-ShareAlike 3.0 license (CC BY-SA 3.0).