isStandardSyntaxProperty.mjs 667 B

1234567891011121314151617181920212223242526272829303132
  1. import hasInterpolation from './hasInterpolation.mjs';
  2. import isScssVariable from './isScssVariable.mjs';
  3. /**
  4. * Check whether a property is standard
  5. *
  6. * @param {string} property
  7. * @returns {boolean}
  8. */
  9. export default function isStandardSyntaxProperty(property) {
  10. // SCSS var
  11. if (isScssVariable(property)) {
  12. return false;
  13. }
  14. // Less var (e.g. @var: x)
  15. if (property.startsWith('@')) {
  16. return false;
  17. }
  18. // Less append property value with space (e.g. transform+_: scale(2))
  19. if (property.endsWith('+') || property.endsWith('+_')) {
  20. return false;
  21. }
  22. // SCSS or Less interpolation
  23. if (hasInterpolation(property)) {
  24. return false;
  25. }
  26. return true;
  27. }