isStandardSyntaxMediaFeatureName.js 320 B

12345678910111213141516
  1. 'use strict';
  2. /**
  3. * Check whether a media feature name is standard
  4. *
  5. * @param {string} mediaFeatureName
  6. * @returns {boolean}
  7. */
  8. module.exports = function isStandardSyntaxMediaFeatureName(mediaFeatureName) {
  9. // SCSS interpolation
  10. if (/#\{.+?\}|\$.+/.test(mediaFeatureName)) {
  11. return false;
  12. }
  13. return true;
  14. };