You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
533 B
26 lines
533 B
'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; |
|
};
|
|
|