isStandardSyntaxProperty.js 388 B

123456789101112131415161718
  1. module.exports = function isStandardSyntaxProperty(property) {
  2. // SCSS var (e.g. $var: x), list (e.g. $list: (x)) or map (e.g. $map: (key:value))
  3. if (property[0] === '$') {
  4. return false;
  5. }
  6. // Less var (e.g. @var: x)
  7. if (property[0] === '@') {
  8. return false;
  9. }
  10. // SCSS or Less interpolation
  11. if (/#{.+?}|@{.+?}|\$\(.+?\)/.test(property)) {
  12. return false;
  13. }
  14. return true;
  15. };