Material-ui: How can we programatically get the raw class names of a component?

Created on 21 Jan 2018  路  2Comments  路  Source: mui-org/material-ui

If we have a Drawer, for example, how can we programmatically get it's raw class names ? (docked, paper, paperAnchorLeft, paperAnchorRight, paperAnchorTop, paperAnchorBottom, paperAnchorDockedLeft, paperAnchorDockedTop, paperAnchorDockedRight, paperAnchorDockedBottom, modal)

I'm needing this because I'm using the Styled Components with Material UI and it is being very painful style some complex components like the Drawer.

I would like to achieve this to create a wrapper function to automatically populate the classes attribute with the raw class names.

question

All 2 comments

how can we programmatically get it's raw class names?

@Danilo-Araujo-Silva You can't pull the values out, you push them. Thanks for publishing this gist by the way: https://gist.github.com/Danilo-Araujo-Silva/2ce11fd0540dcc7eb3ad3e67fd75d02a.

I'm eager to improve the styled-component integration story. Also, you can make the class names predictable: https://material-ui-next.com/customization/css-in-js/#global-css.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

finaiized picture finaiized  路  3Comments

pola88 picture pola88  路  3Comments

ryanflorence picture ryanflorence  路  3Comments

reflog picture reflog  路  3Comments

TimoRuetten picture TimoRuetten  路  3Comments