UnoCss

I feel like a complete idiot. Im looking to add UnoCss to a fresh ct3a repo. Should I just go fro the CLI version and add it to my build and dev scripts?
15 Replies
Vincent Udén
Vincent Udén2y ago
Well, I followed this article I found https://thundermiracle.com/blog/en/2022-06-07-next-with-unocss/ Problem is, running unocss on my tsx file produces 0 generated utilites
Use UnoCSS with Next.js
After reading Anthony Fu’s Reimagine Atomic CSS blog, I’m starting to want to use UnoCSS. Right now, I’m planning to migrate my HP & blog from GatsbyJS to Next…
Vincent Udén
Vincent Udén2y ago
I modified part of the standard template to have a classname I'd expect to work
Vincent Udén
Vincent Udén2y ago
But to no success
needmorewood
needmorewood2y ago
did you try the instructions here first? https://github.com/unocss/unocss/tree/main/packages/webpack
GitHub
unocss/packages/webpack at main · unocss/unocss
The instant on-demand atomic CSS engine. Contribute to unocss/unocss development by creating an account on GitHub.
needmorewood
needmorewood2y ago
also tbh with next just stick with tailwind, i love uno, its fantastic and i use it for everything thats not next setups like the ones in your article arent worth it
Vincent Udén
Vincent Udén2y ago
I have not tried those. Would I create a webpack.config.js in my project root then?
needmorewood
needmorewood2y ago
again not really recommended, would stick with tailwind but thats how one would presumably do it idk if swc affects this at all either
needmorewood
needmorewood2y ago
seems like there is more info and things to try here https://github.com/vercel/next.js/discussions/33254
GitHub
UnoCSS with Next.js · Discussion #33254 · vercel/next.js
Has anybody tried https://github.com/antfu/unocss with Next? Any best practices for integration? UnoCSS seems like a better and more flexible alternative to Tailwind CSS - for an introduction see h...
Vincent Udén
Vincent Udén2y ago
Allright! Thanks for the advice! Im guessing it's easier to use with other backends because they've got different build systems? Like vite for example? I'm kinda new to the whole JS space
needmorewood
needmorewood2y ago
yea uno kind of started after vite 2 was a thing so developing it for something webpack is kinda backwards for him unjs made it so he could provide a webpack story but i dont think people should really use it
Vincent Udén
Vincent Udén2y ago
I see, well I've been meaning to try out astro anyways actually. So I might just go with that instead
needmorewood
needmorewood2y ago
yea if thats an option for you astro is great
Vincent Udén
Vincent Udén2y ago
Already got it up and running with astro. That was so much easier, thank you once again
needmorewood
needmorewood2y ago
No problem, sorry there isn't a good integration with uno With next I mean
Want results from more Discord servers?
Add your server