You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Currently in testing phase so expect bugs but do report them please. 🙏
17
-
18
-
> [!NOTE]
19
-
> This library currently only ships with the **`v3`** release of tailwindcss but I'll soon update it to **`v4`**.
20
-
> You can track the progress with the [#7](https://github.com/THEGOLDENPRO/fastapi-tailwind/issues/7) issue.
16
+
> Currently in alpha phase so expect bugs but do report them please. 🙏
21
17
22
18
## Features ✨
23
19
-[x] Auto watch when in dev mode. 🔎
24
20
-[x] Doesn't require NodeJS and NPM. 🫧🪥
25
21
-[x] Seemless integration into the FastAPI codebase. 🥂
26
-
-[ ] GZIP automatically configured to [compress TailwindCSS](https://v1.tailwindcss.com/docs/controlling-file-size) out of the box. ⚡
22
+
-[ ] GZIP automatically configured to [compress TailwindCSS](https://v2.tailwindcss.com/docs/controlling-file-size) out of the box. ⚡
27
23
28
24
## How to add?
29
25
> [!NOTE]
30
-
> These instructions assume you have a somewhat intermediate understanding of FastAPI and that you've used TailwindCSS before (if you haven't be sure to read the documentation I link in tailwind stages) as I may assume some things.
26
+
> These instructions assume you already have a somewhat intermediate understanding of FastAPI and that you've used TailwindCSS before (if you haven't be sure to read the documentation pages I link below).
27
+
>
28
+
> If you're using Windows you can still replicate these commands via a file explorer.
31
29
32
30
1. Install the pypi package.
33
31
```sh
@@ -86,15 +84,30 @@ def index():
86
84
app.mount("/static", static_files, name="static")
87
85
```
88
86
89
-
3. Make sure the `static` folder exists.
87
+
3. Make sure the `static` folder exists and create a `input.css` file ([in v4 this is now used for configuration](https://tailwindcss.com/docs/upgrade-guide)).
90
88
```sh
91
89
mkdir ./static
90
+
touch input.css
92
91
```
93
-
4. Generate `tailwind.config.js`, then [configure it](https://tailwindcss.com/docs/configuration) appropriately.
92
+
93
+
4. Open `input.css` and write `@import "tailwindcss;` in the file or just run this command:
94
94
```sh
95
-
fastapi-tailwind-init
95
+
echo'@import "tailwindcss";'> input.css
96
96
```
97
-
5. Write your tailwind css in `index.html`.
97
+
98
+
> ### VSCode TailwindCSS Intellisense FIX!
99
+
> There is currently [a bug in the vscode tailwindcss extension](https://github.com/tailwindlabs/tailwindcss/discussions/15132) where you will not get any intellisense in v4 unless we add back the old v3 `tailwind.config.js` file to point to the files with tailwind code in them (e.g. html, markdown, javascript files).
100
+
>
101
+
> A simple, quick and minimal way to fix this for the time being, is to create a file located at `.vscode/settings.json` where our `input.css` file is (should be in root if you followed my previous instructions) and configure it like so:
0 commit comments