-
-
Notifications
You must be signed in to change notification settings - Fork 98
chore(setup): Install and Configure Tailwind CSS #378
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
base: gsoc-feature-branch
Are you sure you want to change the base?
chore(setup): Install and Configure Tailwind CSS #378
Conversation
Signed-off-by: nitro56565 <[email protected]>
@nitro56565 |
We are not using tailwind v4.1 as it still has a lot of compatibility issues.The tailwind vite plugin was released for v4.1 not for v3.4.17 therefore I am using postcss to implement tailwind in our project. |
Do we have any compatibility issues with the existing dependencies or are we limiting ourselves due to browser compatibility concerns?
Firefox is a bit more recent but should we be worried about more than 2 years old Chrome? Practically, mobile browsers are a concern as they may have different compatible versions, but we aren't targeting mobile anyway. I have a tendency to prefer the latest versions of packages, but if we are having any issues with v4 and our existing dependencies, staying on v3 is better. |
Setting Tailwind CSS styles aren't applied due to However, enabling preflight, messes up the existing AntD Learn button: After testing some solutions to this problem, I've found one: Replace the following line of code in
with
Once this change is made, preflight doesn't have to be disabled. This doesn't mess up the Learn button and also the newly added components utilizing Tailwind CSS are rendered correctly. Kindly test this at your end and see if any unexpected behavior is encountered. Without fixing this, Tailwind CSS and AntD components can't co-exist. |
Hey @akshatbatra Preflight was a temporary thing which was eventually going to get reset after total migration but I'll surely check your approach and will test it if everything works fine I'll implement it.👍🏼 |
@nitro56565 Further research revealed that the right way to achieve what we want is to add tailwindcss-scoped-preflight as a dev dependency and then enabling preflight in a scoped way for new Tailwind CSS components that we want to incrementally merge into main while AntD components are still there. I've tested this solution and it works, We don't need to create a custom isolation strategy, already available Something to decide:Merging this PR as it is, doesn't break any existing code, but it breaks the newer Tailwind CSS code that we will merge in forthcoming PRs. AI Assistant panel will probably be the first Tailwind CSS based component to be merged into main, I can set up tailwindcss-scoped-preflight in the upcoming AI Assistant PR itself or you can set that up in this PR. @DianaLease could you please chime in and comment on whether tailwindcss-scoped-preflight should be added in this PR or the forthcoming AI Assistant Panel PR? |
Closes #374
This PR integrates Tailwind CSS into the project to begin the transition from Ant Design to a more modular and performant utility-first CSS approach.
To prevent layout and styling conflicts with existing Ant Design components, Tailwind's preflight (CSS reset) has been disabled.
Changes
Installed tailwindcss, postcss, and autoprefixer
Added Tailwind configuration files: tailwind.config.js, postcss.config.js
Disabled Tailwind’s preflight (reset) via corePlugins: { preflight: false } to avoid breaking existing AntD layout/styling
Imported Tailwind’s base styles in the main CSS file (globals.css, index.css, or equivalent)
Verified that existing Ant Design components render correctly without layout shift
Added Tailwind to the content path for future utility-based development
Flags
Related Issues
Author Checklist
--signoff
option of git commit.gsoc-feature-branch
fromfork:branchname