Skip to content
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

Add type for theme #5429

Merged
merged 1 commit into from
Oct 22, 2020
Merged

Add type for theme #5429

merged 1 commit into from
Oct 22, 2020

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Oct 21, 2020

Fixes #5426

This is only the beginning. Indeed there is a lot of work in order to provide type safe overrides.
See how MUI does it: https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/styles/overrides.d.ts#L103

I also wonder if our approach for the Sidebar size and closedSize configuration is correct. Maybe we should just rely on props with defaults (which can be overridden through the theme as well (https://material-ui.com/customization/globals/#default-props). This would lead to a single entry to customize the sidebar instead of two (sidebar at the theme root and RaSidebar in the overrides)

We would have to export the class keys for every component like this:

export type SidebarClassKey = keyof ReturnType<typeof useStyles>;

This could be a very good opportunity for first time contributors

@djhi djhi added the RFR Ready For Review label Oct 21, 2020
@djhi djhi added this to the 3.9.5 milestone Oct 21, 2020
@fzaninotto fzaninotto merged commit 235c42f into master Oct 22, 2020
@fzaninotto fzaninotto deleted the theme-type branch October 22, 2020 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sidebar option in theming doesn't work
2 participants