blob: 513afa5f03e7d45b337ab99dd2d0ce74efd7799b [file] [log] [blame]
/* @flow */
"use strict";
const hasInterpolation = require("../utils/hasInterpolation");
/**
* Check whether a value is standard
*/
module.exports = function(value /*: string*/) /*: boolean*/ {
let normalizedValue = value;
// Ignore operators before variables (example -$variable)
if (/^[-+*/]/.test(value[0])) {
normalizedValue = normalizedValue.slice(1);
}
// SCSS variable
if (normalizedValue[0] === "$") {
return false;
}
// Less variable
if (normalizedValue[0] === "@") {
return false;
}
// SCSS or Less interpolation
if (hasInterpolation(normalizedValue)) {
return false;
}
return true;
};