forked from cc-archive/vue-vocabulary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyleguide.config.js
143 lines (133 loc) · 3.13 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
const path = require('path')
const capitalize = require('lodash/capitalize')
let viewportMeta = [
'width=device-width',
'initial-scale=1.0',
'user-scalable=no',
'viewport-fit=cover'
].join(', ')
let rootCss = 'https://unpkg.com/@creativecommons/vocabulary/css/root.css'
let families = [
'tokens',
'utils',
'elements',
'layouts',
'patterns',
'templates'
]
let regularFonts = [
'"Source Sans Pro"',
'"Noto Sans"',
'Arial',
'"Helvetica Neue"',
'Helvetica',
'sans-serif'
]
let monospaceFonts = [
'"Fira Code"',
'Consolas',
'"Liberation Mono"',
'Menlo',
'monospace'
]
module.exports = {
// Text
title: 'vo·cab·u·lar·y',
version: 'latest',
// Directory structure
assetsDir: 'src/assets/',
styleguideDir: 'docs/styleguide/',
// Customisation
theme: {
color: {
linkHover: '#000000',
// This is painful manual effort
// Copied from CodeMirror Material theme
// https://codemirror.net/theme/material.css
codeBackground: '#263238',
codeBase: 'rgb(233, 237, 237)',
codeComment: '#546E7A',
codePunctuation: 'rgb(233, 237, 237)',
codeProperty: '#80CBAE',
codeString: '#C3E88D',
codeOperator: 'rgb(233, 237, 237)',
codeKeyword: 'rgb(199, 146, 234)',
codeVariable: '#82B1FF'
},
fontFamily: {
base: regularFonts,
monospace: monospaceFonts
},
borderRadius: 0,
sidebarWidth: 256,
maxWidth: '100%'
},
styles: {
StyleGuide: {
'@global html': { // Copied from root.css
fontFamily: regularFonts,
fontSize: 16,
lineHeight: 1.2
}
}
},
editorConfig: {
theme: 'material',
lineNumbers: true
},
// Additional dependencies
require: [
path.join(__dirname, 'src/icons.js'),
path.join(__dirname, 'styleguidist/i18n.js'),
path.join(__dirname, 'styleguidist/script.js'),
path.join(__dirname, 'styleguidist/style.styl')
],
template: {
head: {
meta: [
{ name: 'viewport', content: viewportMeta }
],
links: [
{ rel: 'stylesheet', href: rootCss },
{ rel: 'icon', href: 'icons/favicon.png' }
]
}
},
// Replaced components
getComponentPathLine: function (componentPath) {
const name = path.basename(componentPath, '.vue')
return `import { ${name} } from '@creativecommons/vocabulary'`
},
renderRootJsx: path.join(__dirname, 'styleguidist/styleguide.root.js'),
// Organisation
defaultExample: false,
pagePerSection: true,
// Contents
components: 'src/**/[A-Z]*.vue',
skipComponentsWithoutExample: true,
sections: [
{
name: 'Vocabulary',
content: 'README.md',
sectionDepth: 1,
sections: [
{
name: 'Code style',
content: 'documentation/metafiles/README.md',
sectionDepth: 1
},
{
name: 'User guide',
content: 'library/metafiles/README.md',
sectionDepth: 1
}
]
},
...families.map(family => ({
name: capitalize(family),
content: `src/${family}/README.md`,
sectionDepth: 1,
components: `src/${family}/[A-Z]*/[A-Z]*.vue`
}))
]
}