functions.mjs 793 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /** @type {ReadonlySet<string>} */
  2. export const camelCaseFunctions = new Set([
  3. 'translateX',
  4. 'translateY',
  5. 'translateZ',
  6. 'scaleX',
  7. 'scaleY',
  8. 'scaleZ',
  9. 'rotateX',
  10. 'rotateY',
  11. 'rotateZ',
  12. 'skewX',
  13. 'skewY',
  14. ]);
  15. /** @type {ReadonlySet<string>} */
  16. export const colorFunctions = new Set([
  17. 'color',
  18. 'color-mix',
  19. 'hsl',
  20. 'hsla',
  21. 'hwb',
  22. 'lab',
  23. 'lch',
  24. 'oklab',
  25. 'oklch',
  26. 'rgb',
  27. 'rgba',
  28. ]);
  29. /** @type {ReadonlySet<string>} */
  30. const singleArgumentMathFunctions = new Set([
  31. 'abs',
  32. 'acos',
  33. 'asin',
  34. 'atan',
  35. 'calc',
  36. 'cos',
  37. 'exp',
  38. 'sign',
  39. 'sin',
  40. 'sqrt',
  41. 'tan',
  42. ]);
  43. /** @type {ReadonlySet<string>} */
  44. export const mathFunctions = new Set([
  45. ...singleArgumentMathFunctions,
  46. 'atan2',
  47. 'calc-size',
  48. 'clamp',
  49. 'hypot',
  50. 'log',
  51. 'max',
  52. 'min',
  53. 'mod',
  54. 'pow',
  55. 'rem',
  56. 'round',
  57. ]);