index.js 703 B

1234567891011121314151617181920212223242526
  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'];