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

Migration to Tailwind v4? #19

Open
SapphicMoe opened this issue Mar 3, 2024 · 7 comments · May be fixed by #22
Open

Migration to Tailwind v4? #19

SapphicMoe opened this issue Mar 3, 2024 · 7 comments · May be fixed by #22
Assignees

Comments

@SapphicMoe
Copy link
Contributor

SapphicMoe commented Mar 3, 2024

I just saw this tweet by Adam Wathan about the early Tailwind v4 alpha:
https://twitter.com/adamwathan/status/1764383146559017048

image

In it, it's mentioned that the Tailwind config file (tailwind.config.mjs) is no longer necessary.

How will this affect the Catppuccin plugin?

@uncenter
Copy link
Member

uncenter commented Mar 3, 2024

https://x.com/adamwathan/status/1764393609246261496:

Plugins and presets will be CSS imports if all goes according to plan 👍

The new "CSS configuration" looks remarkably easy to use so I imagine it won't be too difficult to convert it to that. I'm sure they'll have good documentation on migrating plugins as well.

@nekowinston
Copy link
Contributor

Can't say until they've figured how they want to go about it.
https://twitter.com/adamwathan/status/1764384186478067728

Seems like everything will be CSS based, I assume that there'll be some magic to translate {...config} into CSS directives... we'll see.
I won't offer support for prereleases in any case.

@Master-Hash
Copy link

Tailwind v4 beta is out with migration docs. Now the plugin's theme variable works, but custom classes are broken. Any idea to adapt the new version?

@brianseidman
Copy link

So far the following seems to work in a Tailwind v4 CSS file:

@import "tailwindcss";

@plugin "@catppuccin/tailwindcss"; 

@theme inline {
    --color-ctp-rosewater: rgba(var(--ctp-rosewater));
    --color-ctp-flamingo: rgba(var(--ctp-flamingo));
    --color-ctp-pink: rgba(var(--ctp-pink));
    --color-ctp-mauve: rgba(var(--ctp-mauve));
    --color-ctp-red: rgba(var(--ctp-red));
    --color-ctp-maroon: rgba(var(--ctp-maroon));
    --color-ctp-peach: rgba(var(--ctp-peach));
    --color-ctp-yellow: rgba(var(--ctp-yellow));
    --color-ctp-green: rgba(var(--ctp-green));
    --color-ctp-teal: rgba(var(--ctp-teal));
    --color-ctp-sky: rgba(var(--ctp-sky));
    --color-ctp-sapphire: rgba(var(--ctp-sapphire));
    --color-ctp-blue: rgba(var(--ctp-blue));
    --color-ctp-lavender: rgba(var(--ctp-lavender));
    --color-ctp-text: rgba(var(--ctp-text));
    --color-ctp-subtext1: rgba(var(--ctp-subtext1));
    --color-ctp-subtext0: rgba(var(--ctp-subtext0));
    --color-ctp-overlay2: rgba(var(--ctp-overlay2));
    --color-ctp-overlay1: rgba(var(--ctp-overlay1));
    --color-ctp-overlay0: rgba(var(--ctp-overlay0));
    --color-ctp-surface2: rgba(var(--ctp-surface2));
    --color-ctp-surface1: rgba(var(--ctp-surface1));
    --color-ctp-surface0: rgba(var(--ctp-surface0));
    --color-ctp-base: rgba(var(--ctp-base));
    --color-ctp-mantle: rgba(var(--ctp-mantle));
    --color-ctp-crust: rgba(var(--ctp-crust));
}

I recognize it's basically reassigning all the color variables a second time, but it seems to make the classes work and it is responsive to changing the class between the various Catppuccin flavors.

@uncenter
Copy link
Member

Tailwind doesn't even provide proper/complete documentation on plugins and themes yet, so I'd be patient until v4 fully releases before we can look into upgrading.

@seangenabe
Copy link

Tailwind v4 has been released. https://tailwindcss.com/blog/tailwindcss-v4

Jaezmien added a commit to Jaezmien/tailwindcss that referenced this issue Feb 5, 2025
@sgoudham
Copy link

Hoping to take a stab at this, soon™

@sgoudham sgoudham self-assigned this Feb 23, 2025
@unseen-ninja unseen-ninja linked a pull request Mar 2, 2025 that will close this issue
@sgoudham sgoudham linked a pull request Mar 2, 2025 that will close this issue
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 a pull request may close this issue.

7 participants