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.
TripSit_Suite/node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeature.js
2020-11-01 22:46:04 +00:00

27 lines
533 B
JavaScript

'use strict';
const hasInterpolation = require('../utils/hasInterpolation');
/**
* Check whether a media feature is standard
*
* @param {string} mediaFeature
* @returns {boolean}
*/
module.exports = function (mediaFeature) {
// Remove outside parens
mediaFeature = mediaFeature.slice(1, -1);
// Parentheticals used for non-standard operations e.g. ($var - 10)
if (mediaFeature.includes('(')) {
return false;
}
// SCSS or Less interpolation
if (hasInterpolation(mediaFeature)) {
return false;
}
return true;
};