-
-
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
[docs] Styled API Example (5 lines) #11620
Conversation
@mssngr Thanks for the pull-request.
But it's no longer following the styled-components API. I mean, it's introducing an important difference. Also, this doesn't work for styling the native dom elements. The classes.root need to be applied as a className. The current API ask for the same "hack" than with styled-components: https://material-ui.com/guides/interoperability/#styled-components. I'm not convinced documenting your version would be a better default, while it's definitely interesting. |
Good feedback, thanks! And, I don't know how I missed that page of the documentation. I've gotta rethink my styling strategy, now. |
Was implementing the styled-components API example, but I needed to be able to set classes to the various sub classes in many of
material-ui
's components (such aspaper
in theDrawer
component.) I then realized the API example could be written much more simply while giving it that extra bit of functionality. Decided to do a PR, since it worked so well for me.styled-components
API example down to 5 linesclasses
functionality to thestyled-components
API example