tailwindcss-logical
tailwindcss-logical copied to clipboard
pbs-7.5 doesn't work but pt-7.5 does
I've added @plugin 'tailwindcss-logical'; and have confirmed that the plugin works because pbs-5 works fine. However, pbs-7.5 doesn't work but pt-7.5 does.
Hi @TobyPerplex, hmmm, that should work, and I have a couple test cases for similar classes like pbs-0.5 that work in v4. I’m currently out of town but I’ll check on this when I’m back in a couple days with that exact class and see what happens. Thanks for letting me know.
Yeah no rush. plb-15 also doesn't work, seems like there still is a set list of spacing you can use. Weird, thought I read somewhere that in tailwind4 you can use any value. Hmmmm.
I just gave this a try and I can confirm that anything that wasn't on the Tailwind v3 default scale isn't being generated with this plugin for v4. I think this is because this is using what is now called the "legacy JavaScript-based plugin" API, which works largely the same as it did with v3 for backward compatibility reasons and doesn't support everything in v4.
I don't have a good answer for you yet as updating this plugin to the newer API seems like a large undertaking, but here are some possible solutions that work right now:
- You could use a JavaScript config file (tailwind.config.js), add the values you need to the theme as in v3, and load it with the
@configdirective. - You could use custom values for anything not on the default scale. This could be any value including the measurement unit, such as
pbs-[7.5rem]. - You could also use a custom property value, such as
pbs-(--spacing-7.5)or anything else you like. You would need to create a new variable each time, such as--spacing-7.5: calc(var(--spacing) * 7.5);.
Ah so thats the problem, thanks for finding this out! All great workarounds for now. If you don't have the time updating this plugin to the newer API I'll try and find some time to do a pull request.