isAfterStandardPropertyDeclaration.cjs 853 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. const getPreviousNonSharedLineCommentNode = require('./getPreviousNonSharedLineCommentNode.cjs');
  5. const isCustomProperty = require('./isCustomProperty.cjs');
  6. const typeGuards = require('./typeGuards.cjs');
  7. const isStandardSyntaxDeclaration = require('./isStandardSyntaxDeclaration.cjs');
  8. /**
  9. * @param {import('postcss').Node} node
  10. * @returns {boolean}
  11. */
  12. function isAfterStandardPropertyDeclaration(node) {
  13. const prevNode = getPreviousNonSharedLineCommentNode(node);
  14. return (
  15. prevNode !== undefined &&
  16. typeGuards.isDeclaration(prevNode) &&
  17. isStandardSyntaxDeclaration(prevNode) &&
  18. !isCustomProperty(prevNode.prop || '')
  19. );
  20. }
  21. module.exports = isAfterStandardPropertyDeclaration;