Skip to content

WIP: Tailwind v3 -> v4#37049

Draft
techknowlogick wants to merge 1 commit intogo-gitea:mainfrom
techknowlogick:worktree/tailwind-v4
Draft

WIP: Tailwind v3 -> v4#37049
techknowlogick wants to merge 1 commit intogo-gitea:mainfrom
techknowlogick:worktree/tailwind-v4

Conversation

@techknowlogick
Copy link
Copy Markdown
Member

No description provided.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 30, 2026
@import "./modules/normalize.css";
@import "./modules/animations.css";
@import "./modules/normalize.css" layer(utilities);
@import "./modules/animations.css" layer(utilities);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@silverwind this is definitely not the best choice Ive made here, but perhaps you have a suggestion with what to do for all the layer(utilities)

Copy link
Copy Markdown
Member

@silverwind silverwind Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep it layerless like it was in v3. All you need should be this, no layer declarations anywhere:

@import "tailwindcss/theme";
@import "tailwindcss/utilities";
@config "../../tailwind.config.ts";

Also, layers likely will not work on browsers like Palemoon anyways.

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Mar 31, 2026

  1. Remove the prefix, we are in full control of the CSS and tw: is weird and unneeded. The previous prefix was only because of concerns regarding naming conflicts, but we no longer have them.
  2. Keep the TS config file, it's far more flexible to generate classes with actual code then writing out hundrets of classes by hand. TS config is still fully supported in tailwind 4, you just need to import it from TS.
  3. Follow https://tailwindcss.com/docs/upgrade-guide exactly, there are a ton of breaking changes in tailwind 4.
  4. I think you can drop the postcss dependency and transformer with this.

@wxiaoguang
Copy link
Copy Markdown
Contributor

  1. Remove the prefix, we are in full control of the CSS

Still no at the moment.

I have told you many many times: global pollution and conflicts will definitely cause various bugs and regressions.

A real example: this isn't the first and won't be the last.

image image

@wxiaoguang
Copy link
Copy Markdown
Contributor

And this one, the hidden example I have said many many many times.

image

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Mar 31, 2026

Ok, keep prefix. Possible way to remove prefix later (not in this PR):

  • Find all class name collissions like grid etc
  • Replace CSS for those class names with equivalent tailwind classes

The only danger here is tailwind classes are !important so the resulting specificity will in most cases be higher, but it's very unlikely that that would cause issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/dependencies modifies/frontend modifies/go Pull requests that update Go code modifies/internal modifies/templates This PR modifies the template files topic/code-linting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants