Replies: 1 comment 4 replies
-
I made a small POC for this and its super simple. let me explain Step 1 (hardest part for to put into the generation): Get the tailwind binary for your system: https://github.com/tailwindlabs/tailwindcss/releases/tag/v3.4.14 Step 2: @tailwind base;
@tailwind components;
@tailwind utilities; Step 3: module.exports = {
content: ["./assets/**/*.{html,js}"],
theme: {
extend: {},
},
plugins: [
require('@tailwindcss/typography'),
require('@tailwindcss/forms'),
require('@tailwindcss/aspect-ratio'),
require('@tailwindcss/container-queries'),
],
} Step 4: Step 5: Prod: Result: Maybe together with #786 its even simpler in the dev enviroment Please let me know if this is something that would be accepted as a PR, in which case i would start working on it. |
Beta Was this translation helpful? Give feedback.
-
First up i hope im not opening too many discussions here!
I saw that the server templates add the CDN link for tailwind by default. I love tailwind! BUT i think we could do better.
The CDN ships a huge 150kb CSS file for tailwind. In the frontend world they use things like PostCSS to only ship the css classes that are used inside the project.
Now i was thinking instead of adding the CDN version by default we could ask if the user wants tailwind (this only applies if the user wants server templates. if they use a own js frontend it should be done there). From what i see this is still possible with the Tailwind CLI. Im aware that this would probably require the user to install the CLI by themselves (Just like Redis i guess) but it would heavly cut down the CSS shipped. A medium sized app i worked on ships a CSS file which is 12Kb. which is more than 10x less than the entire CDN version.
Would love to hear some opinions on this!
Beta Was this translation helpful? Give feedback.
All reactions