index.js 874 B

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _postcss = require("postcss");
  6. var _postcss2 = _interopRequireDefault(_postcss);
  7. var _replaceRuleSelector = require("./replaceRuleSelector");
  8. var _replaceRuleSelector2 = _interopRequireDefault(_replaceRuleSelector);
  9. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10. function explodeSelectors() {
  11. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  12. return function (css) {
  13. css.walkRules(function (rule) {
  14. if (rule.selector && rule.selector.indexOf(":matches") > -1) {
  15. rule.selector = (0, _replaceRuleSelector2.default)(rule, options);
  16. }
  17. });
  18. };
  19. }
  20. exports.default = _postcss2.default.plugin("postcss-selector-matches", explodeSelectors);
  21. module.exports = exports.default;