xusd
7 days ago 998218675eb243d43912c203174a6b72b299c0f8
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
/* eslint-disable */
var style = require('../wxs/style.wxs');
 
function rootStyle(data) {
  if (!data.color) {
    return data.customStyle;
  }
 
  var properties = {
    color: data.plain ? data.color : '#fff',
    background: data.plain ? null : data.color,
  };
 
  // hide border when color is linear-gradient
  if (data.color.indexOf('gradient') !== -1) {
    properties.border = 0;
  } else {
    properties['border-color'] = data.color;
  }
 
  return style([properties, data.customStyle]);
}
 
function loadingColor(data) {
  if (data.plain) {
    return data.color ? data.color : '#c9c9c9';
  }
 
  if (data.type === 'default') {
    return '#c9c9c9';
  }
 
  return '#fff';
}
 
module.exports = {
  rootStyle: rootStyle,
  loadingColor: loadingColor,
};