feat(jss-manager-react): add stylesheet overrides as props#282
Merged
chrisdholt merged 12 commits intomasterfrom Apr 19, 2018
Merged
feat(jss-manager-react): add stylesheet overrides as props#282chrisdholt merged 12 commits intomasterfrom
chrisdholt merged 12 commits intomasterfrom
Conversation
chrisdholt
previously approved these changes
Apr 19, 2018
chrisdholt
previously approved these changes
Apr 19, 2018
janechu
requested changes
Apr 19, 2018
| ### Create a react component | ||
| `manageJss` is a HOC that passes as props the generated classes from a given stylesheet. The generated classes are made available on the `managedClasses` prop of the rendered component. | ||
| ```jsx | ||
| // button.js |
| import * as React from "react"; | ||
|
|
||
| class Button extends React.Component { | ||
| render(): { |
Collaborator
There was a problem hiding this comment.
you have a colon, do you want to say this is tsx and return JSX.Element?
| ``` | ||
|
|
||
| ### Create a JSS stylesheet | ||
| You should also create a JSS stylesheet - for detailed information please reference (https://github.com/cssinjs/jss)[https://github.com/cssinjs/jss]. The JSS instance used by the manager uses (jss-preset-default)[https://github.com/cssinjs/jss-preset-default] so feel free to use any syntaxes supported by those plugins. |
Collaborator
There was a problem hiding this comment.
actually (for the cssinjs link) you don't need to re-state the link, in the () you can put some kind of nice text instead of a link, or just leave it off altogether and it should render the link with the address
|
|
||
| const dynamicStyleSheet: any = rendered.state("dynamicStyleSheet"); | ||
|
|
||
| rendered.setProps({jssStyleSheet: {dynamicStylesClass: { margin: "1" }}}); |
Collaborator
There was a problem hiding this comment.
shouldn't a margin need a qualifier like px?
chrisdholt
approved these changes
Apr 19, 2018
janechu
approved these changes
Apr 19, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #3, #281