unplugin / unplugin-icons

🤹 Access thousands of icons as components on-demand universally.
https://www.npmjs.com/package/unplugin-icons
MIT License
4.1k stars 145 forks source link

How to used nuxt 3 with auto import ? #118

Closed productdevbook closed 2 years ago

antfu commented 2 years ago

63 - I'd suggest using UnoCSS on Nuxt 3.

productdevbook commented 2 years ago

63 - I'd suggest using UnoCSS on Nuxt 3.

There are tailwindcss and @apply with scss used codes in the project. I guess we can't switch to UnoCSS.

productdevbook commented 2 years ago
  1. questions
 buildModules: [
    [
      'unplugin-icons/nuxt',
      {
        defaultClass: 'w-7 h-7 inline-block',
        customCollections: {
          red: FileSystemIconLoader('assets/icons'),
        },
      },
    ],
  ],

<red-mdi-book /> [Vue warn]: Failed to resolve component: red-mdi-book

antfu commented 2 years ago

There are tailwindcss and @apply with scss used codes in the project. I guess we can't switch to UnoCSS.

You can have UnoCSS work with Tailwind or other preprocessors by just enabling the icons preset

antfu commented 2 years ago

Auto import for Nuxt is NOT ready - that's what #63 is for

therealokoro commented 2 years ago

There are tailwindcss and @apply with scss used codes in the project. I guess we can't switch to UnoCSS.

You can have UnoCSS work with Tailwind or other preprocessors by just enabling the icons preset

Hello @antfu , so I tried using unocss with only the icon preset but for some reason, unocss still generates other utility classes which conflicts with windicss(i chose to use windicss)😟