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
704 B

4 years ago
  1. "use strict";
  2. var __importStar = (this && this.__importStar) || function (mod) {
  3. if (mod && mod.__esModule) return mod;
  4. var result = {};
  5. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6. result["default"] = mod;
  7. return result;
  8. };
  9. Object.defineProperty(exports, "__esModule", { value: true });
  10. const postcss = __importStar(require("postcss"));
  11. exports.default = postcss.plugin('trim', () => (css) => {
  12. css.walk(({ type, raws }) => {
  13. if (type === 'rule' || type === 'atrule') {
  14. if (raws.before)
  15. raws.before = '\n';
  16. if (raws.after)
  17. raws.after = '\n';
  18. }
  19. });
  20. });