isStandardSyntaxFunction.js 364 B

1234567891011121314151617181920
  1. 'use strict';
  2. /**
  3. * Check whether a function is standard
  4. *
  5. * @param {import('postcss-value-parser').Node} node
  6. * @returns {boolean}
  7. */
  8. module.exports = function (node) {
  9. // Function nodes without names are things in parentheses like Sass lists
  10. if (!node.value) {
  11. return false;
  12. }
  13. if (node.value.startsWith('#{')) {
  14. return false;
  15. }
  16. return true;
  17. };