-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Cannot use theme.overrides with the lab #19427
Comments
Please provide a full reproduction test case. This would help a lot 👷 . |
It seems to be a generic concern with the lab. We don't include the overrides in the default TypeScript definitions. I wonder what would be the best answer here. |
I hit this issue today. Worked around it by putting the following code into my import { SkeletonClassKey } from '@material-ui/lab/Skeleton';
declare module '@material-ui/core/styles/overrides' {
export interface ComponentNameToClassKey {
MuiSkeleton: SkeletonClassKey;
}
} With TypeScript 3.8 I would recommend using @oliviertassinari Maybe the lab package could include something like this in their typings directly? This way lab components should be automatically available when someone has |
I think that it would be interesting to document this problem. Somebody relying on a third-party component would face the same problem. So it's important to have it covered in the docs. @levrik Would it force us to have core depending on the lab? I don't think that developers should expect the same quality from the lab than from the core. I think that we should be willing to take a tradeoff that discriminates against the lab. |
@oliviertassinari No, not at all. I could imagine that lab requires core being installed but I would assume this is already required? In the end this is the same technique you're recommending in the docs when adding custom colors to a theme's palette. |
@levrik Ok so the best approach would be to document? import { SkeletonClassKey } from '@material-ui/lab/Skeleton';
declare module '@material-ui/core/styles/overrides' {
export interface ComponentNameToClassKey {
MuiSkeleton: SkeletonClassKey;
}
} |
@oliviertassinari I think that something like this could be integrated in |
@levrik That's be great! |
Would it require a circular dependency? |
@oliviertassinari /core wouldn't depend on the lab. We would use module augmentation in the lab which already depends on /core. |
@oliviertassinari I'll try to work on this the coming weekend. |
is it still on the agenda to fix this issue? |
Still not overriding |
is there a documentation for overrides? Cant really understand how to use overrides in material-ui DatePicker. Please give an example atleast! |
@ManacyJohn See https://next.material-ui.com/components/about-the-lab/#typescript, it will work as soon as we move the date picker components in the lab. |
@oliviertassinari So the theme augmentation is only on |
@protzman You are right, it only works with v5. You could probably copy and paste the augmentation approach of into your own codebase. |
Would this also work for lab components when trying to When I do this it changes the variant: (core) When I do this it changes the variant: (lab) The |
@potofpie Yes, this should work. Also, in v5, the autocomplete was promoted in the core. |
@oliviertassinari any similar workaround for the DataGrid? I was trying to override MuiDataGrid styles with createTheme, but it seems it's not possible yet (at least with TS). Since the DataGrid theming documentation only refers to v4, what is the plan for v5? Thanks! |
@leolozes Thanks for raising the problem. Yes, great idea. We need to do the same for MUI-X. Issue opened: mui/mui-x#1755. |
Current Behavior 😯
There are no definitions for overriding Alert styles.
Expected Behavior 🤔
MuiAlert
should be overridable.Context 🔦
Using dark theme, alerts are not white on a dark/filled background.
Your Environment 🌎
The text was updated successfully, but these errors were encountered: