sveltejs / svelte-preprocess

A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more.
MIT License
1.73k stars 147 forks source link

add tailwind-as-html preprocessor #557

Closed Temperantia closed 1 year ago

Temperantia commented 1 year ago

Enables using tailwind classes as html attributes

image

Conduitry commented 1 year ago

Are there any other Tailwind integrations out there that support or encourage this?

I have my doubts about this feature, but if we were to add it, it would need to be in a way that doesn't add cheerio as a prod dependency for every user. It would also need to be documented, and preferably would also be opt-in.

Temperantia commented 1 year ago

No, it's only an idea I had a few days ago, I started using it for my own code, it feels a lot more convenient:

I can work on removing cheerio and document a few lines. I'm not sure what you mean by otp-in, it relies on using <template lang="tailwind">

Let me know if that makes sense

kaisermann commented 1 year ago

Hey, @Temperantia 👋 thanks for your idea! We already have some ways of using tailwind that are a bit more conventional (like this one or even this other one). svelte-preprocess tries to stay close to the native transformers, so your suggestion feels like a great case for a custom preprocessor.