units.cjs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 lengthUnits = new Set([
  7. // Font-relative length units
  8. 'cap',
  9. 'ch',
  10. 'em',
  11. 'ex',
  12. 'ic',
  13. 'lh',
  14. 'rcap',
  15. 'rch',
  16. 'rem',
  17. 'rex',
  18. 'ric',
  19. 'rlh',
  20. // Viewport-percentage lengths
  21. 'dvb',
  22. 'dvh',
  23. 'dvi',
  24. 'dvmax',
  25. 'dvmin',
  26. 'dvw',
  27. 'lvb',
  28. 'lvh',
  29. 'lvi',
  30. 'lvmax',
  31. 'lvmin',
  32. 'lvw',
  33. 'svb',
  34. 'svh',
  35. 'svi',
  36. 'svmax',
  37. 'svmin',
  38. 'svw',
  39. 'vb',
  40. 'vh',
  41. 'vi',
  42. 'vw',
  43. 'vmin',
  44. 'vmax',
  45. 'vm',
  46. // Absolute length units
  47. 'px',
  48. 'mm',
  49. 'cm',
  50. 'in',
  51. 'pt',
  52. 'pc',
  53. 'q',
  54. 'mozmm',
  55. // Flexible length units
  56. 'fr',
  57. // Container query units
  58. 'cqw',
  59. 'cqh',
  60. 'cqi',
  61. 'cqb',
  62. 'cqmin',
  63. 'cqmax',
  64. ]);
  65. /** @type {ReadonlySet<string>} */
  66. const resolutionUnits = new Set(['dpi', 'dpcm', 'dppx', 'x']);
  67. /** @type {ReadonlySet<string>} */
  68. const units = uniteSets(lengthUnits, resolutionUnits, [
  69. // Relative length units
  70. '%',
  71. // Time length units
  72. 's',
  73. 'ms',
  74. // Angle
  75. 'deg',
  76. 'grad',
  77. 'turn',
  78. 'rad',
  79. // Frequency
  80. 'Hz',
  81. 'kHz',
  82. ]);
  83. exports.lengthUnits = lengthUnits;
  84. exports.resolutionUnits = resolutionUnits;
  85. exports.units = units;