atKeywords.cjs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 uniteSets = require('../utils/uniteSets.cjs');
  5. /** @type {ReadonlySet<string>} */
  6. const deprecatedAtKeywords = new Set(['document', 'nest', 'viewport']);
  7. /**
  8. * @see https://www.w3.org/TR/css-nesting-1/#conditionals
  9. * @type {ReadonlySet<string>}
  10. */
  11. const nestingSupportedAtKeywords = new Set([
  12. 'apply',
  13. 'container',
  14. 'layer',
  15. 'media',
  16. 'scope',
  17. 'starting-style',
  18. 'supports',
  19. ]);
  20. /**
  21. * @see https://www.w3.org/TR/css-page-3/#syntax-page-selector
  22. * @type {ReadonlySet<string>}
  23. */
  24. const pageMarginAtKeywords = new Set([
  25. 'top-left-corner',
  26. 'top-left',
  27. 'top-center',
  28. 'top-right',
  29. 'top-right-corner',
  30. 'bottom-left-corner',
  31. 'bottom-left',
  32. 'bottom-center',
  33. 'bottom-right',
  34. 'bottom-right-corner',
  35. 'left-top',
  36. 'left-middle',
  37. 'left-bottom',
  38. 'right-top',
  39. 'right-middle',
  40. 'right-bottom',
  41. ]);
  42. /**
  43. * @see https://www.w3.org/TR/css-fonts-4/#font-feature-values-font-feature-value-type
  44. * @type {ReadonlySet<string>}
  45. */
  46. const fontFeatureValueTypes = new Set([
  47. 'annotation',
  48. 'character-variant',
  49. 'historical-forms',
  50. 'ornaments',
  51. 'styleset',
  52. 'stylistic',
  53. 'swash',
  54. ]);
  55. /**
  56. * @see https://developer.mozilla.org/en/docs/Web/CSS/At-rule
  57. * @type {ReadonlySet<string>}
  58. */
  59. const atKeywords = uniteSets(
  60. deprecatedAtKeywords,
  61. nestingSupportedAtKeywords,
  62. pageMarginAtKeywords,
  63. fontFeatureValueTypes,
  64. [
  65. 'counter-style',
  66. 'custom-media',
  67. 'custom-selector',
  68. 'font-face',
  69. 'font-feature-values',
  70. 'font-palette-values',
  71. 'import',
  72. 'keyframes',
  73. 'namespace',
  74. 'page',
  75. 'position-try',
  76. 'property',
  77. 'scroll-timeline',
  78. 'view-transition',
  79. ],
  80. );
  81. exports.atKeywords = atKeywords;
  82. exports.deprecatedAtKeywords = deprecatedAtKeywords;
  83. exports.nestingSupportedAtKeywords = nestingSupportedAtKeywords;
  84. exports.pageMarginAtKeywords = pageMarginAtKeywords;