Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to tailwind 4 #4766

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

upgrade to tailwind 4 #4766

wants to merge 4 commits into from

Conversation

adhami3310
Copy link
Member

No description provided.

Copy link

codspeed-hq bot commented Feb 6, 2025

CodSpeed Performance Report

Merging #4766 will not alter performance

Comparing upgrade-to-tailwind-4 (1e42ee0) with main (b3b79a6)

Summary

✅ 8 untouched benchmarks

@adhami3310
Copy link
Member Author

@carlosabadia i couldn't figure out how to fix reflex-web here. feel free to try

@masenf
Copy link
Collaborator

masenf commented Feb 13, 2025

i tried poking around with these changes

diff --git a/assets/tailwind-theme.css b/assets/tailwind-theme.css
index 92cfba50..a0f54364 100644
--- a/assets/tailwind-theme.css
+++ b/assets/tailwind-theme.css
@@ -1,15 +1,29 @@
 @tailwind base;
 @tailwind components;
 @tailwind utilities;
-
-:root {
-    --font-instrument-sans: 'Instrument Sans', sans-serif;
-    --font-source-code-pro: 'Source Code Pro', monospace;
-    --font-jetbrains: "JetBrains Mono", monospace;
-    color-scheme: light dark;
+@reference '../styles/tailwind.css'
+
+:root {}
+
+/* in tw4, need to define apply-able classes as @utility */
+@utility font-small {
+    font-family: var(--font-instrument-sans);
+    font-size: 0.9rem;
+    font-style: normal;
+    font-weight: 500;
+    line-height: 1.25rem;
+    /* 142.857% */
+    letter-spacing: -0.01094rem;
 }
 
 @layer components {
+    :root {
+        --font-instrument-sans: 'Instrument Sans', sans-serif;
+        --font-source-code-pro: 'Source Code Pro', monospace;
+        --font-jetbrains: "JetBrains Mono", monospace;
+        color-scheme: light dark;
+    }
+
     .font-instrument-sans {
         font-family: var(--font-instrument-sans);
     }
@@ -203,13 +217,7 @@
     }
 
     .font-small {
-        font-family: var(--font-instrument-sans);
-        font-size: 0.9rem;
-        font-style: normal;
-        font-weight: 500;
-        line-height: 1.25rem;
-        /* 142.857% */
-        letter-spacing: -0.01094rem;
+        @apply font-small;
     }
 
     .font-md {

and while that got things to compile, the side didn't look the same.

desktop-only/mobile-only was busted

font sizes were different

i think to make it work, we need to port our relatively complex tailwind config over to the v4 config format.

@carlosabadia
Copy link
Contributor

I'll create a ticket to update it. However, will previous Tailwind versions still be available for use after this is merged?

@adhami3310
Copy link
Member Author

should we add an option to choose what version of tailwind to use ? i'm conflicted

@carlosabadia
Copy link
Contributor

should we add an option to choose what version of tailwind to use ? i'm conflicted

It can be changed in rx.config -> frontend_packages=["[email protected]"]

The v4 wont work though, without the changes in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants