tailwindcss-base-font-size icon indicating copy to clipboard operation
tailwindcss-base-font-size copied to clipboard

tailwind v4 support

Open geoctrl opened this issue 1 year ago • 5 comments

any chance of v4 support?

i've been down the path of getting font-size: 62.5% (base font size of 10) working in v4, but for the life of me, i can't seem to get it working

geoctrl avatar Mar 18 '25 23:03 geoctrl

Any update on this?

rahulkutah avatar Mar 19 '25 04:03 rahulkutah

It should be possible to import the plugin with @plugin "tailwindcss-base-font-size" in your main.css file for tailwind v4.

I can't try it out for myself now, so please let me know, if there any issues with that.

CedericPrivat avatar Mar 24 '25 07:03 CedericPrivat

the error you get when you try that:

Internal server error: Package subpath './defaultConfig' is not defined by "exports" in /Users/tonylefler/projects/full-plate-web/node_modules/tailwindcss/package.json

tailwindcss/defaultConfig isn't defined in tailwind v4 anymore 😢

geoctrl avatar Mar 24 '25 20:03 geoctrl

looks like tailwindcss/resolveConfig got ripped out too

geoctrl avatar Mar 24 '25 20:03 geoctrl

I had a look into it and it seems like they changed the plugin API quite a bit. I tried implementing the same functionality into a css only plugin, which you could just import in your main.css with @import "plugin.css". Unfortunately css currently doesn't support calc() or css variables in media queries, which means that breakpoints wouldn't scale properly.

I'll try to keep the old js plugin but adapt it to the new API. Will keep you updated in this thread!

CedericPrivat avatar Mar 26 '25 17:03 CedericPrivat