Comments (2)
Hey @fdebef
I believe this is the expected behavior:
Source: https://mui.com/material-ui/customization/theming/#api
Here's a fixed demo: https://codesandbox.io/s/unruffled-ardinghelli-gms9hz
from mui-x.
Hey, thanks for answering, but you're talking about merging two themes, but I want to merge Theme (as a result of createTheme
) and options as described in documentation as "Theme composition" (though I agree, that the mention about processing only first argument can be found in same chapter - I am a bit confused).
Theme composition: using theme options to define other options
When the value for a theme option is dependent on another theme option, you should compose the theme in steps.
import { createTheme } from '@mui/material/styles';
let theme = createTheme({
palette: {
primary: {
main: '#0052cc',
},
secondary: {
main: '#edf2ff',
},
},
});
theme = createTheme(theme, {
palette: {
info: {
main: theme.palette.secondary.main,
},
},
});
Think of creating a theme as a two-step composition process: first, you define the basic design options; then, you'll use these design options to compose other options.
Yet one question is, why it works for palette and not for typography.
from mui-x.
Related Issues (20)
- How do I save the table using various states HOT 3
- [datagrid] Refactor: make all selectors accept the same argument
- [DatePicker] `minDate` in DatePicker props enabling dates earlier than specified HOT 6
- [data grid] Resizing doesn't work, even do not have separators between header column by default
- [pickers] Sustainable public API for customization
- [pickers] Allow to select the full date for easy copy-paste HOT 3
- [pickers] Add support for date-fns 3.0 HOT 32
- [DataGrid] Is there a way to open DataGrid in full screen mode? HOT 6
- [DataGrid] capture `onKeyDown` for the filters and header filters HOT 6
- [DataGrid] Pinning group by column with leafField results in incorrect behaviour HOT 4
- [docs] Compatibility version
- [pickers] Is it possible to use pickers in .ASP net website .aspx pages? HOT 2
- [DataGrid] `renderCell` params do not include row values anymore HOT 4
- `hasEval` detection leads to CSP warnings and reports HOT 6
- [core] Security issues with cherry-pick-next-to-master.yml
- [pickers] Problems after update to date-fns 3.0.1 HOT 3
- [DataGrid] Add recipe for pinning the grouped column
- [DataGrid] Maximum Call Stack Size exceeded for `createSelectorMemoized` HOT 10
- [charts] The tooltip should get a position option HOT 3
- I have the following order, when will I be able to download my license key? HOT 1
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 mui-x.