fluid-tailwind icon indicating copy to clipboard operation
fluid-tailwind copied to clipboard

Tailwind v4 Compatibility?

Open rj-elias opened this issue 1 year ago • 47 comments

Is this plugin compatible with Tailwindcss v4?

https://fluid.tw/#installation

Since v4 use rem by default for breakpoints and font size I guess point 3 is no more relevant. But how can I add the extractor in tailwind css v4 since it doesn't use tailwind.config.js anymore.

rj-elias avatar Dec 18 '24 10:12 rj-elias

Hi, it will very likely need a rewrite for Tailwind v4 but I don't want to start working on it until the plugin API is finalized/documented 😶.

barvian avatar Dec 18 '24 13:12 barvian

Pretty weird that v4 doesn't have clamp support out of the box to be honest. Have you asked Adam about this?

daphen avatar Dec 18 '24 13:12 daphen

Pretty weird that v4 doesn't have clamp support out of the box to be honest. Have you asked Adam about this?

@daphen I have not but if you can get a hold of him I'd be curious to hear his thoughts! I'd imagine it'd be a pretty big lift so I'm not expecting a surprise announcement on that front but who knows šŸ˜…

barvian avatar Dec 19 '24 14:12 barvian

Is there any update on the progress of this, when will it work with tailwind v4?

deinternetarchitect avatar Jan 23 '25 15:01 deinternetarchitect

Hi, no update but I'm planning to look into this over the next few weekends šŸ‘

barvian avatar Jan 23 '25 17:01 barvian

You actually won't need this library anymore, since tailwind will be using the @theme directive. You can just use something like this:

@theme { --text-2xs: clamp(0.25rem, 0.162rem + 0.3756vw, 0.5rem); --text-xs: clamp(0.5rem, 0.412rem + 0.3756vw, 0.75rem); --text-s: clamp(0.75rem, 0.662rem + 0.3756vw, 1rem); --text-m: clamp(1rem, 0.8239rem + 0.7512vw, 1.5rem); --text-l: clamp(1.5rem, 1.1479rem + 1.5023vw, 2.5rem); --text-xl: clamp(2rem, 1.4718rem + 2.2535vw, 3.5rem); --text-2xl: clamp(3rem, 2.2958rem + 3.0047vw, 5rem); --text-3xl: clamp(4.0625rem, 2.8521rem + 5.1643vw, 7.5rem); }

And it will work out of the box. You can just overwrite every possible thing such as padding directly.

abeerance avatar Jan 28 '25 09:01 abeerance

You actually won't need this library anymore, since tailwind will be using the @theme directive. You can just use something like this:

@theme { --text-2xs: clamp(0.25rem, 0.162rem + 0.3756vw, 0.5rem); --text-xs: clamp(0.5rem, 0.412rem + 0.3756vw, 0.75rem); --text-s: clamp(0.75rem, 0.662rem + 0.3756vw, 1rem); --text-m: clamp(1rem, 0.8239rem + 0.7512vw, 1.5rem); --text-l: clamp(1.5rem, 1.1479rem + 1.5023vw, 2.5rem); --text-xl: clamp(2rem, 1.4718rem + 2.2535vw, 3.5rem); --text-2xl: clamp(3rem, 2.2958rem + 3.0047vw, 5rem); --text-3xl: clamp(4.0625rem, 2.8521rem + 5.1643vw, 7.5rem); }

And it will work out of the box. You can just overwrite every possible thing such as padding directly.

Hi, you could already do this in Tailwind v3 and it works well. The goal of this plugin is to let you generate these values on-the-fly in any utility using your existing theme values šŸ‘

barvian avatar Jan 28 '25 19:01 barvian

You actually won't need this library anymore, since tailwind will be using the @theme directive. You can just use something like this: @theme { --text-2xs: clamp(0.25rem, 0.162rem + 0.3756vw, 0.5rem); --text-xs: clamp(0.5rem, 0.412rem + 0.3756vw, 0.75rem); --text-s: clamp(0.75rem, 0.662rem + 0.3756vw, 1rem); --text-m: clamp(1rem, 0.8239rem + 0.7512vw, 1.5rem); --text-l: clamp(1.5rem, 1.1479rem + 1.5023vw, 2.5rem); --text-xl: clamp(2rem, 1.4718rem + 2.2535vw, 3.5rem); --text-2xl: clamp(3rem, 2.2958rem + 3.0047vw, 5rem); --text-3xl: clamp(4.0625rem, 2.8521rem + 5.1643vw, 7.5rem); } And it will work out of the box. You can just overwrite every possible thing such as padding directly.

Hi, you could already do this in Tailwind v3 and it works well. The goal of this plugin is to let you generate these values on-the-fly in any utility using your existing theme values šŸ‘

Ah sweet didn't know that, excited what you come up with then :)

abeerance avatar Jan 28 '25 20:01 abeerance

while the @theme solution is nice! Are you still planning to update this package though? I really like the way we can "tailwindify" our projects by using the class & utilities.

Amiejah avatar Jan 31 '25 14:01 Amiejah

while the @theme solution is nice! Are you still planning to update this package though? I really like the way we can "tailwindify" our projects by using the class & utilities.

Hi, I'm still planning on it yes. Tailwind v4 doesn't have an upgrade guide for third-party plugins, or any official API for third-party plugins in general, so there's a bit more guesswork than I would've hoped. v4 also silently dropped support for custom extractors, so it will definitely require a complete rewrite.

barvian avatar Jan 31 '25 17:01 barvian

Thank you for your work @barvian Glad to see that it is planned

joffreypersia avatar Feb 19 '25 13:02 joffreypersia

Appreciate all you're doing @barvian and am also pumped to know you're still planning work on this.

kjwessa avatar Feb 20 '25 16:02 kjwessa

Was this what you were waiting for? https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.9

Make JS APIs available to plugins and configs in the Standalone CLI

stijns96 avatar Feb 26 '25 08:02 stijns96

Also really interested in the migration to v4! Has anyone tried it with the @plugin directive?

nbbaier avatar Feb 28 '25 02:02 nbbaier

I'm very interested in seeing an implementation for v4, especially because @container queries are supported and would like to see this library also support those for even more flexibility. Is this something your considering @barvian ?

maartenjongerius-enfold avatar Mar 05 '25 11:03 maartenjongerius-enfold

I'm very interested in seeing an implementation for v4, especially because @container queries are supported and would like to see this library also support those for even more flexibility. Is this something your considering @barvian ?

Hi @maartenjongerius-enfold šŸ‘‹, yes I'm planning container query support. The current plugin supports them too: https://fluid.tw/#container-queries

barvian avatar Mar 05 '25 15:03 barvian

@barvian I’m really excited about this plugin! Do you have any idea when Tailwind 4.0 support will be released?

timvandaatselaar avatar Mar 07 '25 09:03 timvandaatselaar

@timvandaatselaar Hi, unfortunately not as I'm quite busy with work at the moment. It'll be at least a month I'd imagine 😬

barvian avatar Mar 10 '25 20:03 barvian

@timvandaatselaar Hi, unfortunately not as I'm quite busy with work at the moment. It'll be at least a month I'd imagine 😬

@barvian Are you to open to outsider help?

lqze avatar Mar 15 '25 01:03 lqze

As a stop gap solution I made this simple plugin that generates all the CSS classes. Of course there are some drawbacks and the API is not as clean, but maybe it can be useful for some of you

michaelbrusegard avatar Mar 22 '25 21:03 michaelbrusegard

Eagerly waiting for the upgrade to v4, this is one of the best tailwind plugins

Your fans are cheering you on @barvian

mercury7design avatar Apr 01 '25 03:04 mercury7design

To be honest, I don't think they will drop support for the @plugin at-rule anytime soon. There are to many plugins that can not simply be build with native css and the new at-rules they supplied.

I also can't really find other issue comments or docs that is in development where they even talk about some soort of JS plugin solution.

stijns96 avatar Apr 01 '25 06:04 stijns96

To be honest, I don't think they will drop support for the @plugin at-rule anytime soon. There are to many plugins that can not simply be build with native css and the new at-rules they supplied.

I also can't really find other issue comments or docs that is in development where they even talk about some soort of JS plugin solution.

@barvian see #17460

stijns96 avatar Apr 01 '25 06:04 stijns96

Also interested!

gustaveWPM avatar Apr 03 '25 21:04 gustaveWPM

How have I only just discovered this plugin?! Just wanted to add another +1 to your pool of on-cheerers for a TW4 update šŸ‘

spaceballstheuser avatar Apr 05 '25 19:04 spaceballstheuser

+1! interested in the v4 update! :) šŸ’Ŗ

rongshabing avatar Apr 15 '25 13:04 rongshabing

I tried living without the plugin and life is just not the same, it's so painful not having nice fluid sizing 😭

(I may be over-egging that a bit but it's true)

RyanRoberts avatar Apr 15 '25 19:04 RyanRoberts

Same for me. Life with the plugin is so much better šŸ˜„

deinternetarchitect avatar Apr 15 '25 19:04 deinternetarchitect

I made a similar plugin before learning about fluid.tw: https://github.com/nicolas-cusan/tailwind-clamp It works a little different, leveraging the arbitrary CSS syntax: clamp-[...].

I recently updated it to work with Tailwind v4, so l leave it here in case it helps anyone.

nicolas-cusan avatar Apr 21 '25 15:04 nicolas-cusan

I made a similar plugin before learning about fluid.tw: https://github.com/nicolas-cusan/tailwind-clamp It works a little different, leveraging the arbitrary CSS syntax: clamp-[...].

I recently updated it to work with Tailwind v4, so l leave it here in case it helps anyone.

thank you so much for this

vehktaur1840 avatar Apr 24 '25 01:04 vehktaur1840