isScssVariable.cjs 595 B

12345678910111213141516171819202122232425
  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. /**
  5. * Check whether a property is SCSS variable
  6. *
  7. * @param {string} property
  8. * @returns {boolean}
  9. */
  10. function isScssVariable(property) {
  11. // SCSS var (e.g. $var: x), list (e.g. $list: (x)) or map (e.g. $map: (key:value))
  12. if (property.startsWith('$')) {
  13. return true;
  14. }
  15. // SCSS var within a namespace (e.g. namespace.$var: x)
  16. if (property.includes('.$')) {
  17. return true;
  18. }
  19. return false;
  20. }
  21. module.exports = isScssVariable;