isStandardSyntaxMathFunction.js 359 B

123456789101112131415161718192021
  1. 'use strict';
  2. /**
  3. * Check whether a math function is standard
  4. *
  5. * @param {string} mathFunction
  6. * @returns {boolean}
  7. */
  8. module.exports = function isStandardSyntaxMathFunction(mathFunction) {
  9. // SCSS variable
  10. if (mathFunction.includes('$')) {
  11. return false;
  12. }
  13. // Less variable
  14. if (mathFunction.includes('@')) {
  15. return false;
  16. }
  17. return true;
  18. };