Welcome to mirror list, hosted at ThFree Co, Russian Federation.

findMediaOperator.js « rules « lib « stylelint « node_modules « assets - github.com/fourtyone11/origin-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 47d36b36ef7169da43a1edc2cf46dbe4b0edc250 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'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);
	});
};