tailwindcss icon indicating copy to clipboard operation
tailwindcss copied to clipboard

Space utilities not working with flex order

Open scottzirkel opened this issue 5 years ago • 4 comments

When changing the flex order of elements, the space utilities are not updated. They are still applied in the original DOM order.

Here's an example: https://play.tailwindcss.com/2vqKZW1mPW

scottzirkel avatar Mar 11 '21 02:03 scottzirkel

Duplicate of https://github.com/tailwindlabs/tailwindcss/issues/3724

adamwathan avatar Mar 11 '21 02:03 adamwathan

Hey @adamwathan, I saw that issue, I don't think it's a dupe. That is dealing with the reverse order, not specifying the flex order. order-{n} is what I'm trying to use.

Here's a screenshot of the playground to better show what I mean. The spacing of the top three are off, but the spacing of the bottom are correct.

Screen Shot 2021-03-10 at 8 54 47 PM

scottzirkel avatar Mar 11 '21 02:03 scottzirkel

Bleh sorry trigger happy on this one. Yeah in this case it's just gonna be a limitation of what's possible in CSS, not really any way for us to automatically support that. space-x-{n} is just a shortcut for "add margin to everything except the first child", so if that's not the behavior you need, you'll have to just add margin to each element manually.

adamwathan avatar Mar 11 '21 02:03 adamwathan

OK cool. Was afraid that's what it was. Thanks!

scottzirkel avatar Mar 11 '21 02:03 scottzirkel