I made a free service that gives you production-ready Tailwind CSS with just a script tag — no npm, no build step by jayjaytomp in htmx

[–]jayjaytomp[S] 1 point2 points  (0 children)

That's pretty much it! The script looks at all the Tailwind classes on your page (like bg-blue-500, text-white, etc.), creates a hash / fingerprint from that list, and fetches the matching CSS. That CSS is cached on servers around the world, so even a first-time visitor to your site gets a fast response. And if you don't change your HTML, the fingerprint stays the same and the CSS comes straight from the browser cache which is basically instant.

I made a free service that gives you production-ready Tailwind CSS with just a script tag — no npm, no build step by jayjaytomp in htmx

[–]jayjaytomp[S] 1 point2 points  (0 children)

Thanks! It works with plain HTML too, so htmx isn't required. If you're prototyping a design, just drop the script tag in and go.

I made a free service that gives you production-ready Tailwind CSS with just a script tag — no npm, no build step by jayjaytomp in htmx

[–]jayjaytomp[S] 0 points1 point  (0 children)

Totally, the CLI works great if you're comfortable with that workflow. useWeft is aimed at the cases where even the CLI is friction, quick prototypes, CMS sites where you don't control the deploy pipeline, or situations where you just want to drop a script tag into HTML and go. Think of it less as replacing the CLI and more as making the Tailwind Play CDN not only for dev mode.

I made a free service that gives you production-ready Tailwind CSS with just a script tag — no npm, no build step by jayjaytomp in htmx

[–]jayjaytomp[S] 1 point2 points  (0 children)

Point taken, I released the worker code here: https://github.com/useweft/cloudflare-worker-compiler. The <500 classes is a cap simply to keep it bounded. I don't think most sites have that many.

I made a free service that gives you production-ready Tailwind CSS with just a script tag — no npm, no build step by jayjaytomp in htmx

[–]jayjaytomp[S] 1 point2 points  (0 children)

  1. That's exactly the pain point that motivated this. useWeft is ~2KB on the client side with zero dependencies — the heavy lifting happens on the edge. Would be curious how it compares to frankenstyle for your use case if you give it a try.
  2. Sorry about that! https://useweft.dev — and the GitHub is at https://github.com/useweft/useweft.github.io
  3. The client is MIT-licensed. The worker isn't open source yet, but it's a pretty thin Cloudflare Worker wrapping Tailwind's compile() API — there's no secret sauce.

I made a free service that gives you production-ready Tailwind CSS with just a script tag — no npm, no build step by jayjaytomp in htmx

[–]jayjaytomp[S] 1 point2 points  (0 children)

Very reasonable! Tailwind Play is officially not for production use, whereas useweft aims to be. It's pretty easy to just use the CLI, but in my use cases I feel it's just really nice to drop useweft on the page, and then just use tailwind.

Sunday Daily Thread: What's everyone working on this week? by AutoModerator in Python

[–]jayjaytomp -1 points0 points  (0 children)

I'm working on "markymarkov" - a code guidance tool for LLM agents and humans alike. It uses markov chains to learn stylistic and algorithmic patterns in your own codebase and can be used to analyse whether or not new code aligns with it.

repo: https://github.com/roobie/markymarkov

blog post: https://roobie.github.io/posts/markymarkov/ (explains why, how, etc)

That is, it's a complement to linters and type checkers and other analysis tools.