denoland / fresh

The next-gen web framework.
https://fresh.deno.dev
MIT License
12.56k stars 648 forks source link

Styling integrations #290

Open dragonwocky opened 2 years ago

dragonwocky commented 2 years ago

Hey! I've been using UnoCSS with Fresh privately for a while, updating it as Fresh has evolved, and it's seemed to be pretty reliable/fast/capable. I've made that integration available here and documented how to use it: https://github.com/dragonwocky/deno_tools#fresh_unocss

What might be the best way for that to be made available for Fresh users? Just leaving it there as-is, or publishing a module on https://deno.land/x/, or opening a PR to add it to Fresh itself? Is there a plan for any sort of plugin system with Fresh? I expect if that is planned, it might be complex to do right and wouldn't be part of v1.0.0.

I've noticed that the styling page of the docs is still empty, and I'd be happy to write that up, referencing how to use UnoCSS, Twind, post-processed stylesheets and normal stylesheets.

Side question: the _app.tsx route isn't documented yet either, and it doesn't really look like there's a gap where it would fit into the current docs? I'd be curious to know the plan for/intended uses of that.

lucacasonato commented 2 years ago

I'd love to add plugins for styling integrations. I have unfortunately not found the right way to do this yet, and it won't be part of 1.0.0.

Once I have more time to work on plugins (hopefully in a couple of weeks), we can figure out how to integrate UnoCSS as a CSS engine. Ideally it would just be a built in plugin in the Fresh repo :)

miguelrk commented 1 year ago

FYI: just opened PR https://github.com/denoland/fresh/pull/1303 which adds a unocss plugin based on the new renderAsync() method 👍🏼