Sanakey
2021-01-31 53cc6f817625897935fb10c3845ad7be400f3036
提交 | 用户 | age
53cc6f 1 /* eslint-disable */
S 2 var style = require('../wxs/style.wxs');
3
4 function rootStyle(data) {
5   if (!data.color) {
6     return data.customStyle;
7   }
8
9   var properties = {
10     color: data.plain ? data.color : '#fff',
11     background: data.plain ? null : data.color,
12   };
13
14   // hide border when color is linear-gradient
15   if (data.color.indexOf('gradient') !== -1) {
16     properties.border = 0;
17   } else {
18     properties['border-color'] = data.color;
19   }
20
21   return style([properties, data.customStyle]);
22 }
23
24 function loadingColor(data) {
25   if (data.plain) {
26     return data.color ? data.color : '#c9c9c9';
27   }
28
29   if (data.type === 'default') {
30     return '#c9c9c9';
31   }
32
33   return '#fff';
34 }
35
36 module.exports = {
37   rootStyle: rootStyle,
38   loadingColor: loadingColor,
39 };