1
0
mirror of https://github.com/thangisme/notes.git synced 2024-11-01 05:37:16 -04:00
notes/node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeature.js

24 lines
524 B
JavaScript
Raw Normal View History

2017-03-09 13:16:08 -05:00
/* @flow */
"use strict"
const hasInterpolation = require("../utils/hasInterpolation")
/**
* Check whether a media feature is standard
*/
module.exports = function (mediaFeature/*: string*/)/*: boolean*/ {
// Remove outside parens
mediaFeature = mediaFeature.slice(1, -1)
// Parentheticals used for non-standard operations e.g. ($var - 10)
if (mediaFeature.indexOf("(") !== -1) {
return false
}
// SCSS or Less interpolation
if (hasInterpolation(mediaFeature)) {
return false
}
return true
}