You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
617 B

4 years ago
  1. module.exports = function compressFontWeight(node) {
  2. var value = node.children.head.data;
  3. if (value.type === 'Identifier') {
  4. switch (value.name) {
  5. case 'normal':
  6. node.children.head.data = {
  7. type: 'Number',
  8. loc: value.loc,
  9. value: '400'
  10. };
  11. break;
  12. case 'bold':
  13. node.children.head.data = {
  14. type: 'Number',
  15. loc: value.loc,
  16. value: '700'
  17. };
  18. break;
  19. }
  20. }
  21. };