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.

20 lines
569 B

4 years ago
  1. var resolveName = require('css-tree').property;
  2. var handlers = {
  3. 'font': require('./property/font'),
  4. 'font-weight': require('./property/font-weight'),
  5. 'background': require('./property/background'),
  6. 'border': require('./property/border'),
  7. 'outline': require('./property/border')
  8. };
  9. module.exports = function compressValue(node) {
  10. if (!this.declaration) {
  11. return;
  12. }
  13. var property = resolveName(this.declaration.property);
  14. if (handlers.hasOwnProperty(property.basename)) {
  15. handlers[property.basename](node);
  16. }
  17. };