isKeyframeRule.cjs 533 B

1234567891011121314151617181920212223
  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 typeGuards = require('./typeGuards.cjs');
  5. /**
  6. * Check if a rule is a keyframe one
  7. *
  8. * @param {import('postcss').Rule} rule
  9. * @returns {boolean}
  10. */
  11. function isKeyframeRule(rule) {
  12. const parent = rule.parent;
  13. if (!parent) {
  14. return false;
  15. }
  16. return typeGuards.isAtRule(parent) && parent.name.toLowerCase() === 'keyframes';
  17. }
  18. module.exports = isKeyframeRule;