-
Notifications
You must be signed in to change notification settings - Fork 14
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
how to use withStyles
#49
Comments
@codekiln I'm using https://github.com/SentiaAnalytics/bs-css with success. I've followed https://material-ui-next.com/customization/css-in-js/#other-html-element and made two modules: The objective is to create a noscript on index.hml to serve as a place holder for the css material-ui injects <noscript id="jss-insertion-point"></noscript> Before make on the main component you write
That'll cook InsertionPoint.jss which will instruct JssProvider the css injection point on the index.html. Wrap the main jsx render with JssProvider
Now you can declare your css on the beautiful bs-css dsl, like so:
and pass styles##key via className. It's nice to use an object styles, becase we don't polute the module namespace and the awesome bucklescript compiler complains if you pass styles##wrongkey to className. Never mind Breakpoints, it's a helper module to expose material-ui's breakpoints object https://gist.github.com/geraldodev/eb18ea44e7435ee78c470dc30c7124da |
When using Material UI, it's common to use
import { withStyles } from 'material-ui/styles';
. How would I go about making a styled component, for example, like the CheckboxList in the examples?The text was updated successfully, but these errors were encountered: