-
Notifications
You must be signed in to change notification settings - Fork 76
/
config.js
43 lines (37 loc) · 1.1 KB
/
config.js
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
31
32
33
34
35
36
37
38
39
40
41
42
43
import { configure, addDecorator, addParameters } from '@storybook/html';
import { makeDecorator } from '@storybook/addons'
// import { withStyles } from 'storybook-addon-styles/vue'
import '../packages/style.css'
import '../.storybook-vue/style.css'
const withStyles = makeDecorator({
name: 'withStyles',
parameterName: 'styles',
skipIfNoParametersOrOptions: true,
wrapper: (getStory, context, { options, parameters }) => {
const root = document.createElement('div')
Object.assign(root.style, options, parameters)
const story = getStory(context)
if (typeof story === 'string') {
root.innerHTML = story
} else if (story instanceof Node) {
root.appendChild(story)
}
return root
}
})
addDecorator(withStyles)
addParameters({
options: {
showPanel: false
},
styles: {
margin: '0 auto',
padding: '40px 24px 0',
maxWidth: '400px',
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif',
}
})
function loadStories() {
require('../packages/autocomplete-js/Autocomplete.stories.js')
}
configure(loadStories, module);