1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.default = void 0;
|
---|
7 |
|
---|
8 | var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
|
---|
9 |
|
---|
10 | var _exists = _interopRequireDefault(require("../exists"));
|
---|
11 |
|
---|
12 | var _isMixin = _interopRequireDefault(require("../isMixin"));
|
---|
13 |
|
---|
14 | var _plugin = _interopRequireDefault(require("../plugin"));
|
---|
15 |
|
---|
16 | var _browsers = require("../dictionary/browsers");
|
---|
17 |
|
---|
18 | var _identifiers = require("../dictionary/identifiers");
|
---|
19 |
|
---|
20 | var _postcss = require("../dictionary/postcss");
|
---|
21 |
|
---|
22 | var _tags = require("../dictionary/tags");
|
---|
23 |
|
---|
24 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
---|
25 |
|
---|
26 | function analyse(ctx, rule) {
|
---|
27 | return selectors => {
|
---|
28 | selectors.each(selector => {
|
---|
29 | if ((0, _exists.default)(selector, 0, _tags.BODY) && (0, _exists.default)(selector, 1, ':empty') && (0, _exists.default)(selector, 2, ' ') && selector.at(3)) {
|
---|
30 | ctx.push(rule, {
|
---|
31 | identifier: _identifiers.SELECTOR,
|
---|
32 | hack: selector.toString()
|
---|
33 | });
|
---|
34 | }
|
---|
35 | });
|
---|
36 | };
|
---|
37 | }
|
---|
38 |
|
---|
39 | var _default = (0, _plugin.default)([_browsers.FF_2], [_postcss.RULE], function (rule) {
|
---|
40 | if ((0, _isMixin.default)(rule)) {
|
---|
41 | return;
|
---|
42 | }
|
---|
43 |
|
---|
44 | (0, _postcssSelectorParser.default)(analyse(this, rule)).processSync(rule.selector);
|
---|
45 | });
|
---|
46 |
|
---|
47 | exports.default = _default;
|
---|
48 | module.exports = exports.default; |
---|