Files: 8461f5116e38210324ed4dfd92a4b8fae57407d9 / modules_core / style / styles.js
767 bytesRaw
1 | var compile = require('micro-css') |
2 | var fs = require('fs') |
3 | var Path = require('path') |
4 | |
5 | // TODO distribute these styles across all |
6 | // the relevant modules, not as a core style. |
7 | var coreStyle = fs.readFileSync(Path.join(__dirname, '../../style.css')) |
8 | |
9 | module.exports = { |
10 | needs: { |
11 | mcss: 'map', |
12 | css: 'map' |
13 | }, |
14 | gives: { |
15 | mcss: true, |
16 | css: true, |
17 | styles: true |
18 | }, |
19 | create: function (api) { |
20 | var styles = '' |
21 | process.nextTick(function () { |
22 | var mcss = api.mcss().join('\n') |
23 | var css = api.css().join('\n') |
24 | styles = coreStyle + compile(mcss) + css |
25 | }) |
26 | return { |
27 | styles: function () { return styles }, |
28 | // export empty styles |
29 | mcss: function () { return '' }, |
30 | css: function () { return '' } |
31 | } |
32 | } |
33 | } |
34 |
Built with git-ssb-web