-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"presets": [ ["env", {"modules": false} ]] | ||
"presets": [ ["env", {"modules": false} ]] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import {createElement as h} from 'react'; | ||
import {storiesOf} from '@storybook/react'; | ||
const {action} = require('@storybook/addon-actions'); | ||
const {linkTo} = require('@storybook/addon-links'); | ||
const {create} = require('../lib'); | ||
const {addonSheet} = require('../addon/sheet'); | ||
|
||
const renderer = create(h); | ||
addonSheet(renderer); | ||
const {sheet} = renderer; | ||
|
||
const styles = sheet({ | ||
tomato: { | ||
bd: '1px solid tomato', | ||
}, | ||
yellow: { | ||
bd: '1px solid yellow', | ||
}, | ||
}, 'hello'); | ||
|
||
|
||
const styles2 = renderer.sheet({ | ||
tomato: { | ||
bd: '1px solid tomato', | ||
}, | ||
yellow: { | ||
bd: '1px solid yellow', | ||
}, | ||
}); | ||
|
||
storiesOf('sheet()', module) | ||
.add('Default', () => | ||
h('div', null, | ||
h('div', {className: styles.tomato}, 'Red'), | ||
h('div', {className: styles.yellow}, 'Yellow'), | ||
) | ||
) | ||
.add('No block name', () => | ||
h('div', null, | ||
h('div', {className: styles2.tomato}, 'Red'), | ||
h('div', {className: styles2.yellow}, 'Yellow'), | ||
) | ||
) |
This file contains 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