isStandardSyntaxProperty.cjs 864 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // NOTICE: This file is generated by Rollup. To modify it,
  2. // please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
  3. 'use strict';
  4. const hasInterpolation = require('./hasInterpolation.cjs');
  5. const isScssVariable = require('./isScssVariable.cjs');
  6. /**
  7. * Check whether a property is standard
  8. *
  9. * @param {string} property
  10. * @returns {boolean}
  11. */
  12. function isStandardSyntaxProperty(property) {
  13. // SCSS var
  14. if (isScssVariable(property)) {
  15. return false;
  16. }
  17. // Less var (e.g. @var: x)
  18. if (property.startsWith('@')) {
  19. return false;
  20. }
  21. // Less append property value with space (e.g. transform+_: scale(2))
  22. if (property.endsWith('+') || property.endsWith('+_')) {
  23. return false;
  24. }
  25. // SCSS or Less interpolation
  26. if (hasInterpolation(property)) {
  27. return false;
  28. }
  29. return true;
  30. }
  31. module.exports = isStandardSyntaxProperty;