regexes.cjs 962 B

123456789101112131415161718192021222324252627282930313233343536
  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 atKeywords = require('../reference/atKeywords.cjs');
  5. const atRuleRegexes = {
  6. mediaName: /^media$/i,
  7. keyframesName: /^(-(o|moz|ms|webkit)-)?keyframes$/i,
  8. propertyName: /^property$/i,
  9. importName: /^import$/i,
  10. unsupportedNestingNames: new RegExp(
  11. `^((?!${[...atKeywords.nestingSupportedAtKeywords.values()].join('|')}).)*$`,
  12. 'i',
  13. ),
  14. layerName: /^layer$/i,
  15. containerName: /^container$/i,
  16. scopeName: /^scope$/i,
  17. };
  18. const descriptorRegexes = {
  19. syntaxName: /^syntax$/i,
  20. };
  21. const functionRegexes = {
  22. layer: /layer\((.*?)\)/i,
  23. };
  24. const propertyRegexes = {
  25. containerNameAndShorthandName: /^container(-name)?$/i,
  26. };
  27. exports.atRuleRegexes = atRuleRegexes;
  28. exports.descriptorRegexes = descriptorRegexes;
  29. exports.functionRegexes = functionRegexes;
  30. exports.propertyRegexes = propertyRegexes;