Blame view

node_modules/csso/lib/compressor/compress/property/font-weight.js 621 Bytes
aaac7fed   liuqimichale   add
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  module.exports = function compressFontWeight(node) {
      var value = node.sequence.head.data;
  
      if (value.type === 'Identifier') {
          switch (value.name) {
              case 'normal':
                  node.sequence.head.data = {
                      type: 'Number',
                      info: value.info,
                      value: '400'
                  };
                  break;
              case 'bold':
                  node.sequence.head.data = {
                      type: 'Number',
                      info: value.info,
                      value: '700'
                  };
                  break;
          }
      }
  };