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

[system] Improve the sx prop IntelliSense #23599

Merged
merged 41 commits into from
Nov 18, 2020

Conversation

mnajdova
Copy link
Member

@mnajdova mnajdova commented Nov 18, 2020

This PR improves the typings on the sx prop.

Closes #23219
Closes #15451

It is mostly using the types from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/styled-system__css/index.d.ts with slight adjustments to our needs

Overriden css prop

image

Custom css prop

image

Css prop as function
image

@mnajdova mnajdova changed the title Feat/system type improvements [system] Improve the sx prop IntelliSense Nov 18, 2020
@mui-pr-bot
Copy link

mui-pr-bot commented Nov 18, 2020

No bundle size changes

Generated by 🚫 dangerJS against 4f2e57b

@eps1lon
Copy link
Member

eps1lon commented Nov 18, 2020

Question: Where is the sx prop actually implemented? It doesn't look like /core/Box is responsible for that.

@mnajdova
Copy link
Member Author

Question: Where is the sx prop actually implemented? It doesn't look like /core/Box is responsible for that.

The unstable_styleFunctionSx which is part of the system is implementing it. This utility is used in the experimentalStyled() - our custom styled() utility and is automatically added on all components created with it - hence the Box and the styled Slider have it.

@eps1lon
Copy link
Member

eps1lon commented Nov 18, 2020

Is there anything more you want to add or is this PR actual ready for review? My question made sense before you moved it form Box to system.

@mnajdova
Copy link
Member Author

Is there anything more you want to add or is this PR actual ready for review? My question made sense before you moved it from Box to system.

It is actual ready for review, was addressing the moving as part of #23599 (comment) didn't seem necessary to create new PR for just that. Sorry for the confusion.

mnajdova and others added 19 commits November 18, 2020 20:21
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
mnajdova and others added 9 commits November 18, 2020 20:49
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
Co-authored-by: Matt <github@nospam.33m.co>
@mnajdova mnajdova merged commit bbf2485 into mui:next Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: system Specific to @mui/system typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Box] sx prop IntelliSense not working [system] Box accept any value in TypeScript
5 participants