This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
2020-11-01 22:46:04 +00:00

25 lines
521 B
JavaScript

// @ts-nocheck
'use strict';
const rangeOperators = ['>=', '<=', '>', '<', '='];
const styleSearch = require('style-search');
module.exports = function (atRule, cb) {
if (atRule.name.toLowerCase() !== 'media') {
return;
}
const params = atRule.raws.params ? atRule.raws.params.raw : atRule.params;
styleSearch({ source: params, target: rangeOperators }, (match) => {
const before = params[match.startIndex - 1];
if (before === '>' || before === '<') {
return;
}
cb(match, params, atRule);
});
};