Files: f6391d5b5450e27f0c7a8dba7d82a53c4ad2634a / modules_core / styles.js
764 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