forked from webkom/lego-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyleguide.config.js
92 lines (88 loc) · 2.04 KB
/
styleguide.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
const path = require('path');
const root = path.resolve(__dirname, '.');
const webpackConfig = require('./config/webpack.client.js')(undefined, {
mode: 'production'
});
webpackConfig.resolve.modules.push('lib');
webpackConfig.module.rules.push({
include: path.resolve(root, 'lib'),
loader: 'babel-loader'
});
module.exports = {
sections: [
{
name: 'Lego-Webapp README',
content: 'README.md'
},
{
name: 'Components',
components: 'app/components/*/*.js'
},
{
name: 'Style guidelines',
sections: [
{
name: 'Content layout',
content: 'docs/layout.md'
},
{
name: 'Headers',
content: 'docs/headers.md'
},
{
name: 'Sidebars',
content: 'docs/sidebars.md'
},
{
name: 'Tables',
content: 'docs/tables.md'
},
{
name: 'Mobile',
content: 'docs/mobile.md'
},
{
name: 'Backgrounds',
content: 'docs/backgrounds.md'
},
{
name: 'List items',
content: 'docs/list-items.md'
},
{
name: 'Styling',
sections: [
{
content: 'app/styles/README.md'
},
{
name: 'CSS Files',
content: '.css.tmp.md'
}
]
}
]
}
],
context: {},
defaultExample: false,
require: [
'app/styles/icomoon.css',
'app/styles/variables.css',
'app/styles/globals.css'
],
webpackConfig,
// Show the import statements we use in this project
getComponentPathLine(componentPath) {
const name = path.basename(componentPath, '.js');
const dir = path.dirname(componentPath);
let import_name =
name === 'index' ? dir.substr(dir.lastIndexOf('/') + 1) : `{ ${name} }`;
return `import ${import_name} from '${dir}';`;
},
logger: {
// Suppress all warnings - you can remove this when debugging
info: () => {},
warn: () => {}
}
};