uno.config.js 1.8 KB

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