-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
48 lines (40 loc) · 1.11 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
'use strict';
let layout = {};
layout['base-scale'] = 5; // Base scale in px
module.exports = {
name: require('./package').name,
config(environment, appConfig) {
let initialConfig = Object.assign({}, appConfig);
let updatedConfig = this.addons.reduce((config, addon) => {
if (addon.config) {
Object.assign(config, addon.config(environment, config));
}
return config;
}, initialConfig);
return updatedConfig;
},
isDevelopingAddon() {
return true;
},
included() {
let config = this.project.config()['ember-assembly'] || { styles: {} };
let virtualModules = {
layout: Object.assign({}, layout, config.styles.layout),
};
this.options = Object.assign({}, this.options, {
cssModules: {
virtualModules,
plugins: [
require('postcss-functions')({
functions: {
scale: function (value) {
return value * virtualModules['layout']['base-scale'] + 'px';
},
},
}),
],
},
});
this._super.included.apply(this, arguments);
},
};