1 | 'use strict';
|
2 |
|
3 | const rangeOperators = ['>=', '<=', '>', '<', '='];
|
4 | const styleSearch = require('style-search');
|
5 |
|
6 | module.exports = function (atRule, cb) {
|
7 | if (atRule.name.toLowerCase() !== 'media') {
|
8 | return;
|
9 | }
|
10 |
|
11 | const params = atRule.raws.params ? atRule.raws.params.raw : atRule.params;
|
12 |
|
13 | styleSearch({ source: params, target: rangeOperators }, (match) => {
|
14 | const before = params[match.startIndex - 1];
|
15 |
|
16 | if (before === '>' || before === '<') {
|
17 | return;
|
18 | }
|
19 |
|
20 | cb(match, params, atRule);
|
21 | });
|
22 | };
|