Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<img width="2551" alt="image" src="https://github.com/user-attachments/assets/c8180213-1a0b-4b63-b6eb-851b913f6054"> ## [Example project](https://utopia.fish/p/5c03b0e5-glorious-coconut/?branch_name=feature-tailwind-class-compilation&Tailwind=true) ## Description This PR removes twind (as it's not maintained anymore), and replaces it with https://github.com/mhsdesign/jit-browser-tailwindcss/, which builds on tailwindcss to compile tailwind classes. ### Details - The code wrapping `twind` is removed - Wrapper code is added for https://github.com/mhsdesign/jit-browser-tailwindcss/ (`useTailwindCompilation`) - A Karma test is added to check whether some tailwind classes are compiled correctly (`tailwind.spec.browser2.tsx`). The test is intentionally coarse-grained, because exhaustively testing every tailwind feature is out of scope, and the example store heavily uses tailwind anyway - Generating the tailwind styles depends on whether the project has a tailwind.config.js file or not. Down the line we'll change this to checking in a flag in the `"utopia"` section of `package.json`, the current implementation is there to keep the PR self-contained - `isTailwindEnabled` and `TAILWIND_INSTANCE.current`: `isTailwindEnabled` should be a pure function of `projectContents`. However, that implementation caused a lot of re-renders, so instead I mirrored the original implementation that checked whether a module-private variable was set or not - Stubbed `@mhsdesign/jit-browser-tailwindcss` in Jest
- Loading branch information