https://github.com/codefromanywhere/tailwindstatic
Use Tailwind with zero setup for static HTML
https://github.com/codefromanywhere/tailwindstatic
Last synced: 6 months ago
JSON representation
Use Tailwind with zero setup for static HTML
- Host: GitHub
- URL: https://github.com/codefromanywhere/tailwindstatic
- Owner: CodeFromAnywhere
- Created: 2024-11-18T14:43:15.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-18T15:35:39.000Z (about 1 year ago)
- Last Synced: 2024-11-18T16:49:34.402Z (about 1 year ago)
- Language: TypeScript
- Homepage: https://tailwindstatic.vercel.app
- Size: 47.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tailwind-static
Use Tailwind with zero setup for static HTML
The idea is simple: use `` in your html, and when the HTML is loaded in the browser, the script will look up the origin to determine which classes are needed. It will respond with all of tailwind if it can't reach the origin (e.g. if it was localhost or file://) or it will extract the specific classes it needs and compile a static CSS file for your HTML page.
# Insight
After having done this I'm only seeing that https://cdn.tailwindcss.com is actuallly a JS file. LOL! Missed that. That means likely that it is reading the entire website on-demand i guess already, so the advantage to doing it on the backend and then serve a CSS is minimal. The only advantage would be that it maybe faster on subsequent requests (if it's cached via CDN)
The problem now I'm running into is that the 'referer' header is actually only the origin part of the URL but we need the entire URL of the static html file!