UNPKG

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