background.js 550 B

1234567891011121314151617181920212223
  1. var OptimizationLevel = require('../../../options/optimization-level').OptimizationLevel;
  2. var plugin = {
  3. level1: {
  4. property: function background(_rule, property, options) {
  5. var values = property.value;
  6. if (!options.level[OptimizationLevel.One].optimizeBackground) {
  7. return;
  8. }
  9. if (values.length == 1 && values[0][1] == 'none') {
  10. values[0][1] = '0 0';
  11. }
  12. if (values.length == 1 && values[0][1] == 'transparent') {
  13. values[0][1] = '0 0';
  14. }
  15. }
  16. }
  17. };
  18. module.exports = plugin;