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

feat!: migrate to tailwindcss v4 #7

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mikededo
Copy link
Owner

@mikededo mikededo commented Feb 7, 2025

This PR includes the migration of TailwindCSS to v4. This version changes makes
TailwindCSS rely mostly on CSS files, over other configuration formats. Taking
advantage of this migrations, many things are changed in favour of a simpler
setup.
Ideally, I'd want to also simplify the output CSS, as previously it is was a
mess.

Changes/Roadmap

  • Removal of postcss tw configuration, in favor of running tw with the new
    vite plugin.
  • Removed the usage of prefixes. While initially I thought it was a good
    idea, I ended up having issues in the new version, as variables such as color
    variables are being duplicated with each prefix. I'd prefer re-using variables
    as it would simplify the code and the CSS size. This means that special care
    will be required when re-using classes as some already generated classes may be
    overlapped and due to the cascade approach, be ignored.
    This will, for sure, help in having a reduced CSS file output. Another approach
    that could be worth looking into, is serving CSS files separately. Having
    different links into the generated CSS files from the various packages and then
    the CSS of the app itself, taking precedence. This approach would difficult
    reducing the output CSS, and would require more investigation on how would tw
    generate the classes. Most likely using the @source directive would help.
  • Removal of plugins in favor of plain CSS and tw generated layers. For
    example, the typography plugin now is simply a CSS file exported from
    @stack/tailwind-config.
  • Remove the aria plugin in favour of tw-aria

@mikededo mikededo self-assigned this Feb 7, 2025
Copy link

vercel bot commented Feb 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
advent ❌ Failed (Inspect) Feb 7, 2025 10:26am

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.

1 participant