uno.config.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders'
  2. import presetRemToPx from '@unocss/preset-rem-to-px'
  3. import { defineConfig, presetAttributify, presetIcons, presetWind3 } from 'unocss'
  4. import { getIcons } from './build/index.js'
  5. const icons = getIcons()
  6. export default defineConfig({
  7. presets: [
  8. presetWind3(),
  9. presetAttributify(),
  10. presetIcons({
  11. warn: true,
  12. prefix: ['i-'],
  13. extraProperties: {
  14. display: 'inline-block',
  15. width: '1em',
  16. height: '1em',
  17. },
  18. collections: {
  19. me: FileSystemIconLoader('./src/assets/icons/isme'),
  20. fe: FileSystemIconLoader('./src/assets/icons/feather'),
  21. },
  22. }),
  23. presetRemToPx({ baseFontSize: 4 }),
  24. ],
  25. safelist: icons.map(icon => `${icon} ${icon}?mask`.split(' ')).flat(),
  26. shortcuts: [
  27. ['wh-full', 'w-full h-full'],
  28. ['f-c-c', 'flex justify-center items-center'],
  29. ['flex-col', 'flex flex-col'],
  30. ['card-border', 'border border-solid border-light_border dark:border-dark_border'],
  31. ['auto-bg', 'bg-white dark:bg-dark'],
  32. ['auto-bg-hover', 'hover:bg-#eaf0f1 hover:dark:bg-#1b2429'],
  33. ['auto-bg-highlight', 'bg-#eaf0f1 dark:bg-#1b2429'],
  34. ['text-highlight', 'rounded-4 px-8 py-2 auto-bg-highlight'],
  35. ],
  36. rules: [
  37. [
  38. 'card-shadow',
  39. { 'box-shadow': '0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017' },
  40. ],
  41. ],
  42. theme: {
  43. colors: {
  44. primary: 'rgba(var(--primary-color))',
  45. dark: '#18181c',
  46. light_border: '#efeff5',
  47. dark_border: '#2d2d30',
  48. },
  49. },
  50. })