uno.config.ts 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import { defineConfig } from '@unocss/vite';
  2. import presetUno from '@unocss/preset-uno';
  3. import transformerDirectives from '@unocss/transformer-directives';
  4. export default defineConfig({
  5. exclude: ['node_modules', 'dist', '.git', '.husky', '.vscode', 'public', 'build', 'mock', './stats.html'],
  6. presets: [presetUno({ dark: 'class' })],
  7. transformers: [transformerDirectives()],
  8. shortcuts: {
  9. 'wh-full': 'w-full h-full',
  10. 'flex-center': 'flex justify-center items-center',
  11. 'flex-col-center': 'flex-center flex-col',
  12. 'flex-x-center': 'flex justify-center',
  13. 'flex-y-center': 'flex items-center',
  14. 'i-flex-center': 'inline-flex justify-center items-center',
  15. 'i-flex-x-center': 'inline-flex justify-center',
  16. 'i-flex-y-center': 'inline-flex items-center',
  17. 'flex-col': 'flex flex-col',
  18. 'flex-col-stretch': 'flex-col items-stretch',
  19. 'i-flex-col': 'inline-flex flex-col',
  20. 'i-flex-col-stretch': 'i-flex-col items-stretch',
  21. 'flex-1-hidden': 'flex-1 overflow-hidden',
  22. 'absolute-lt': 'absolute left-0 top-0',
  23. 'absolute-lb': 'absolute left-0 bottom-0',
  24. 'absolute-rt': 'absolute right-0 top-0',
  25. 'absolute-rb': 'absolute right-0 bottom-0',
  26. 'absolute-tl': 'absolute-lt',
  27. 'absolute-tr': 'absolute-rt',
  28. 'absolute-bl': 'absolute-lb',
  29. 'absolute-br': 'absolute-rb',
  30. 'absolute-center': 'absolute-lt flex-center wh-full',
  31. 'fixed-lt': 'fixed left-0 top-0',
  32. 'fixed-lb': 'fixed left-0 bottom-0',
  33. 'fixed-rt': 'fixed right-0 top-0',
  34. 'fixed-rb': 'fixed right-0 bottom-0',
  35. 'fixed-tl': 'fixed-lt',
  36. 'fixed-tr': 'fixed-rt',
  37. 'fixed-bl': 'fixed-lb',
  38. 'fixed-br': 'fixed-rb',
  39. 'fixed-center': 'fixed-lt flex-center wh-full',
  40. 'nowrap-hidden': 'whitespace-nowrap overflow-hidden',
  41. 'ellipsis-text': 'nowrap-hidden text-ellipsis',
  42. 'transition-base': 'transition-all duration-300 ease-in-out'
  43. },
  44. theme: {
  45. colors: {
  46. primary: 'rgb(var(--primary-color))',
  47. primary_hover: 'rgb(var(--primary-color-hover))',
  48. primary_pressed: 'rgb(var(--primary-color-pressed))',
  49. primary_active: 'rgba(var(--primary-color-active),0.1)',
  50. primary_1: 'rgb(var(--primary-color1))',
  51. primary_2: 'rgb(var(--primary-color2))',
  52. primary_3: 'rgb(var(--primary-color3))',
  53. primary_4: 'rgb(var(--primary-color4))',
  54. primary_5: 'rgb(var(--primary-color5))',
  55. primary_6: 'rgb(var(--primary-color6))',
  56. primary_7: 'rgb(var(--primary-color7))',
  57. primary_8: 'rgb(var(--primary-color8))',
  58. primary_9: 'rgb(var(--primary-color9))',
  59. info: 'rgb(var(--info-color))',
  60. info_hover: 'rgb(var(--info-color-hover))',
  61. info_pressed: 'rgb(var(--info-color-pressed))',
  62. info_active: 'rgb(var(--info-color-active),0.1)',
  63. success: 'rgb(var(--success-color))',
  64. success_hover: 'rgb(var(--success-color-hover))',
  65. success_pressed: 'rgb(var(--success-color-pressed))',
  66. success_active: 'rgb(var(--success-color-active),0.1)',
  67. warning: 'rgb(var(--warning-color))',
  68. warning_hover: 'rgb(var(--warning-color-hover))',
  69. warning_pressed: 'rgb(var(--warning-color-pressed))',
  70. warning_active: 'rgb(var(--warning-color-active),0.1)',
  71. error: 'rgb(var(--error-color))',
  72. error_hover: 'rgb(var(--error-color-hover))',
  73. error_pressed: 'rgb(var(--error-color-pressed))',
  74. error_active: 'rgb(var(--error-color-active),0.1)',
  75. dark: '#18181c'
  76. }
  77. }
  78. });