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.HTML) && ((0, _exists.default)(selector, 1, '>') || (0, _exists.default)(selector, 1, '~')) && selector.at(2) && selector.at(2).type === 'comment' && (0, _exists.default)(selector, 3, ' ') && (0, _exists.default)(selector, 4, _tags.BODY) && (0, _exists.default)(selector, 5, ' ') && selector.at(6)) {
|
---|
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.IE_5_5, _browsers.IE_6, _browsers.IE_7], [_postcss.RULE], function (rule) {
|
---|
40 | if ((0, _isMixin.default)(rule)) {
|
---|
41 | return;
|
---|
42 | }
|
---|
43 |
|
---|
44 | if (rule.raws.selector && rule.raws.selector.raw) {
|
---|
45 | (0, _postcssSelectorParser.default)(analyse(this, rule)).processSync(rule.raws.selector.raw);
|
---|
46 | }
|
---|
47 | });
|
---|
48 |
|
---|
49 | exports.default = _default;
|
---|
50 | module.exports = exports.default; |
---|