-
Notifications
You must be signed in to change notification settings - Fork 30
/
index.js
37 lines (27 loc) · 871 Bytes
/
index.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
'use strict'
const camelcase = require('camelcase')
const buildCss = require('tachyons-build-css')
const DEFAULT_CONFIG = require('./config')
const generateDocs = require('./docs')
const generate = require('./lib/generate')
const assembleCss = require('./lib/assemble-css')
module.exports = config => {
const _config = Object.assign({}, DEFAULT_CONFIG, config)
const mediaQueries = _config.customMedia
generator.generate = async () => {
const modules = await generate(_config, mediaQueries)
const post = await assembleCss(modules, _config)
const min = await buildCss(post, { minify: true })
const css = await buildCss(post)
const docs = generateDocs(_config, { modules, min: min.css })
return {
post,
modules,
css: css.css,
min: min.css,
docs
}
}
function generator () {}
return generator
}