File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,16 +31,21 @@ const PrimaryButton = styled(Button, {
3131Using base Style Sheet we can share classes between styled primitives.
3232
3333``` js
34- import { Styled } from ' styled-jss'
35- import injectSheet from ' react-jss'
34+ import { Styled , injectStyled } from ' styled-jss'
3635
3736// Base styles, like a regular jss object.
3837const styled = Styled ({
3938 root: {
40- margin: 10
39+ margin: 10 ,
40+ ' & $baseButton' : {
41+ fontSize: 16
42+ }
4143 },
4244 baseButton: {
43- padding: 10
45+ padding: 10 ,
46+ ' & + &' : {
47+ marginLeft; 10
48+ }
4449 }
4550})
4651
@@ -58,11 +63,12 @@ const PrimaryButton = styled(NormalButton, {
5863// One can use classes AND styled primitives.
5964const MyComponent = ({classes}) => (
6065 < div className= {classes .root }>
66+ < NormalButton> normal button< / NormalButton>
6167 < PrimaryButton> primary button< / PrimaryButton>
6268 < / div>
6369)
6470
65- const MyStyledComponent = injectSheet (styled . styles )(MyComponent)
71+ const MyStyledComponent = injectStyled (styled)(MyComponent)
6672```
6773
6874### With custom JSS setup:
You can’t perform that action at this time.
0 commit comments