News for hackers. Stuff that matters.
Re:Play with TailwindCSS in the Browser by irrational on Friday June 10, 2022 @08:47AM (#31693320)
> They've gone a bit crazy with the latest features

Can you elaborate? What are the latest features?

Re:Play with TailwindCSS in the Browser by yurishimo on Friday June 10, 2022 @12:47PM (#31696535)
I think they are referring to custom values. As a part of the move to the JIT compiler, it's possible to define arbitrary classes and have Tailwind pick up on it and create a class.

Consider this. `text-red-500` is an out of the box class from TW that gives you a solid red text color. With the new JIT compiler, I can write `text-[#BADA55]` and the compiler is smart enough to generate a class with that hex code as the value for the color. You can use this syntax for almost any available class.

This feature is useful for some cases (marketing sites with finicky pixel perfect requirements) but it can also be abused. It's up to your team to decide where it makes sense to break out of the design system, or if you should add that new value as a token to be reused throughout the app.

Re:Play with TailwindCSS in the Browser by config_yml on Friday June 10, 2022 @10:15AM (#31694522)
Arbitrary Variants looks a bit crazy to me (I haven't used it yet though): https://github.com/tailwindlabs/tailwindcss/pull/8299
Re:Play with TailwindCSS in the Browser by criswell on Friday June 10, 2022 @12:02PM (#31695997)
I know it's going to be abused to hell like everything popular but definitely a useful power tool.

It'll be really nice for container queries when they're ready. Something like: `wider-than-[500px]:hover:text-red-500` and so on.

Also super nice for `:has` (although ordering is a concern at the moment): `[:has(:invalid)]:bg-red-500`.