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.

25 lines
703 B

4 years ago
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _postcss = require('postcss');
  6. var _alphanumSort = require('alphanum-sort');
  7. var _alphanumSort2 = _interopRequireDefault(_alphanumSort);
  8. var _uniqs = require('uniqs');
  9. var _uniqs2 = _interopRequireDefault(_uniqs);
  10. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11. function unique(rule) {
  12. rule.selector = (0, _alphanumSort2.default)((0, _uniqs2.default)(rule.selectors), { insensitive: true }).join();
  13. }
  14. exports.default = (0, _postcss.plugin)('postcss-unique-selectors', () => {
  15. return css => css.walkRules(unique);
  16. });
  17. module.exports = exports['default'];