Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnoCSS compatibility #27

Open
cloydlau opened this issue Oct 22, 2024 · 5 comments
Open

UnoCSS compatibility #27

cloydlau opened this issue Oct 22, 2024 · 5 comments
Labels
documentation Improvements or additions to documentation enhancement Enhancement of existing feature

Comments

@cloydlau
Copy link

Great project. May I ask, I am using UnoCSS but the documentation says that Tailwind must be installed, it would be very unscientific to have to bring in two CSS frameworks from the same domain in order to use this library. Is there any compatibility measures for UnoCSS users?

@rahul-vashishtha
Copy link
Member

Hi @cloydlau,
One of our discord member found that Inspira UI works well with UnoCSS, as long as the classes from tailwind and UnoCSS have same name and functionality. So far, things works fine with default UnoCSS setup, AFAIK.

I'm personally doing some tests to verify if all components are compatible with UnoCSS.
Once I'm done with all the verification, I'll release a documentation to make Inspira UI work with UnoCSS.

@Faudelhadroug
Copy link

Hey @cloydlau,

You can start using Inspira-ui with UnoCSS like this:

  • (UnoCSS already installed)
  • add the vueuse (core & motion), clsx and tailwind-merge dependencies.
  • add Inspira as dev dependency (-D @inspira-ui/plugins).
  • add the lib/utils.ts file as provided in the documentation.

That's it!

Note: Some components that use Utility Classes, like "Pattern Backgrounds", might not work as expected, but you can manually make them functional by adjusting the Utility Classes. For example, in the DotBackground component, change

"bg-dot-black/[0.2]"

to

"bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:16px_16px]"

and it will work as expected.

Note2: If you want to use shadcn, I recommend you this preset. If you encounter any issues and need installation details, feel free to ask me.

@llds66
Copy link

llds66 commented Oct 23, 2024

@Faudelhadroug how to set inspira-ui/plugins and tailwindcss-animate dependencies in UnoCSS+Inspira-ui?

@rahul-vashishtha rahul-vashishtha added enhancement Enhancement of existing feature documentation Improvements or additions to documentation labels Oct 23, 2024
@rahul-vashishtha
Copy link
Member

@Faudelhadroug how to set inspira-ui/plugins and tailwindcss-animate dependencies in UnoCSS+Inspira-ui?

inspira-ui/plugins only support tailwindcss at this point of time. For animate, you can use https://www.npmjs.com/package/unocss-preset-animations .

@vampirefan
Copy link

Hi @cloydlau, One of our discord member found that Inspira UI works well with UnoCSS, as long as the classes from tailwind and UnoCSS have same name and functionality. So far, things works fine with default UnoCSS setup, AFAIK.

I'm personally doing some tests to verify if all components are compatible with UnoCSS. Once I'm done with all the verification, I'll release a documentation to make Inspira UI work with UnoCSS.

Yes, a simple workaround can be very useful for users using Unocss instead of tailwindcss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement Enhancement of existing feature
Projects
None yet
Development

No branches or pull requests

5 participants