Skip to content

Commit d8e897b

Browse files
committed
Add JSS composes example
1 parent 7829fd4 commit d8e897b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tutorial/08-bootstrap-jss.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,10 @@ const styles = {
427427
color: 'red',
428428
},
429429
},
430+
specialButton: {
431+
composes: ['btn', 'btn-primary'],
432+
backgroundColor: 'limegreen',
433+
},
430434
}
431435

432436
const HomePage = ({ classes }: { classes: Object }) =>
@@ -435,6 +439,7 @@ const HomePage = ({ classes }: { classes: Object }) =>
435439
<h3 className="mb-3">JSS</h3>
436440
<p className={classes.hoverMe}>Hover me.</p>
437441
<p className={classes.resizeMe}>Resize the window.</p>
442+
<button className={classes.specialButton}>Composition</button>
438443
</div>
439444
// [...]
440445

@@ -447,7 +452,7 @@ Unlike React inline styles, JSS uses classes. You pass styles to `injectSheet` a
447452
448453
**Note**: In production mode, the `data-meta` is obfuscated. Sweet!
449454
450-
If you hover over the "Hover me" label, it should turn red. If you resize your browser window to be narrower than 800px, the "Resize your window" label should turn red.
455+
If you hover over the "Hover me" label, it should turn red. If you resize your browser window to be narrower than 800px, the "Resize your window" label should turn red. The green button is extending Bootstrap's CSS classes using JSS' `composes` property.
451456
452457
Next section: [09 - Travis, Coveralls, Heroku](09-travis-coveralls-heroku.md#readme)
453458

0 commit comments

Comments
 (0)