Comments (3)
Thanks for the report @chbiel! This looks like something we should improve for v7 when we update our designs. Would an API like Joy UI's CSS vars components tokens help?
There's actually very brief documentation about it here: https://mui.com/material-ui/react-text-field/#customization. If anyone wishes to open a PR to improve that docs section to be more thorough until we fix this properly, that would be very welcome.
from material-ui.
hey @DiegoAndai, thanks for getting back :)
I did not had a look into Joy UI yet, but I will take a look.
I think my point is more in the direction of consistency instead of how to customize.
And maybe it's more a kind of discussion instead of an issue (beside improving the docs for the moment).
So we are currently trying to create a theme for our company and getting into the details I get more and more confused.
One of the examples I mentioned above: I can define a full theme, but the FilledInput seems not to be compliant with all the rest, as the different color shades are defined in the component itself instead of picking configuration from the theme.
I know I can explicitly target the different css classes and slots to overwrite those, but that does not feel right from a library point that offers different configurations, but does not pick them up here.
And the FilledInput
has fixed values e.g. for box shadow instead of using theme variables:
What in the end renders the
FilledInput
from my perspective as not compliant with the theme approach
, but instead forces a user to copy over the whole component css definitions and overwrite every color.
Another thing I found is, that (at least in the MenuItem, did not check other places yet) palette.action.selected
is used based on the primary color. And I did not find a central way to overwrite that behaviour.
material-ui/packages/mui-material/src/MenuItem/MenuItem.js
Lines 84 to 86 in 90f655a
That leads to a greenish background color what does not fit into the whole design at all.
So it feels like either the whole Theme configuration is not explained in a way that I understand it or the different theme configurations are not used in a consistent way. I think I should not need to read the underlying source code to understand how to customize a component.
But maybe I am missing something here so please correct me if I am wrong.
And sorry for getting a little bit off-issue-topic... :)
from material-ui.
Thanks @chbiel for the detailed feedback 🤩
So it feels like either the whole Theme configuration is not explained in a way that I understand it or the different theme configurations are not used in a consistent way. I think I should not need to read the underlying source code to understand how to customize a component.
This resonates with me, and I think with much of the community. We plan to revamp the theme structure for v7. Specifically, we will likely adopt Material Design 3's token structure, which should help by:
- Providing consistency in how theme tokens are used in components
- Providing an easy way to override those tokens via CSS variables
This is still somewhat speculative as we haven't started planning v7 in detail yet. Improving look and feel will be the main topic of that major release, so we'll be looking into the theme structure, and this feedback will be very useful.
from material-ui.
Related Issues (20)
- [material-ui][Accordion] `AccordionDetails` is not visible when passing custom component through slotProps.transition HOT 2
- [material-ui] v5.15.8 still not available on npm after 18+ hours HOT 8
- [material-ui][Select] Not working with the styled input prop: Prop `className` did not match HOT 1
- [material-ui][Tooltip] Not closing when DOM changes: re-rendering HOT 4
- [material-ui][Avatar] Source is loaded twice by Safari with `loading: "lazy"` set HOT 2
- [material-ui] Inconsistent spacing units between components under default styling HOT 4
- [material-ui] Update TypeScript supports in v6
- [material-ui][Rating] Component does not respect name property when generating input element id HOT 4
- [material-ui][stepper][docs] react-swipeable-views in Stepper demo is no longer maintained HOT 1
- [base-ui] Menu click away is broken if `transitionDuration` CSS property is used HOT 3
- [material-ui][List] On applying high contrast themes, the focus indicator on the list items under "Movie" combo box is not visible in all the modes HOT 1
- [Autocomplete] Console error in Next.js App Router project: A props object containing a "key" prop is being spread into JSX HOT 1
- [material-ui][Autocomplete] Due to the multiple option value the input field size getting larger
- [material-ui][Autocomplete] Value not shown after object reaching the condition it should HOT 7
- [docs-infra] Create a custom 404 page for the docs HOT 1
- [material-ui][docs] Missing icon and installation instructions in new landing page template HOT 3
- [joy-ui][Modal] How to put it in the top of the screen (vertical positioning)? HOT 2
- [docs] Demo MultipleSelect crashes
- [material-ui][Autocomplete] Requiring double escape key press to trigger `clearOnEscape` HOT 6
- [material-ui][Autocomplete] Dropdown arrow visible with readOnly prop set to true
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from material-ui.