-
-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathgoogleFont.stories.js
More file actions
30 lines (25 loc) · 860 Bytes
/
googleFont.stories.js
File metadata and controls
30 lines (25 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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('../index');
const {addon: addonRule} = require('../addon/rule');
const {addon: addonGoogleFont} = require('../addon/googleFont');
const nano = create();
addonRule(nano);
addonGoogleFont(nano);
nano.googleFont('Roboto');
nano.googleFont('Roboto Slab', 700);
const className1 = nano.rule({
fontFamily: '"Roboto"'
}, 'Roboto');
const className2 = nano.rule({
fontFamily: '"Roboto Slab"'
}, 'Roboto_Slab');
storiesOf('Addons/googleFont', module)
.add('Roboto', () =>
h('div', {className: className1}, 'Hello world')
)
.add('Roboto Slab, bold', () =>
h('div', {className: className2}, 'Hello world')
)