Replies: 4 comments 5 replies
-
I'm not sure if this will answer your specific situation, but I tend to construct my own grid templates using named grid areas like so: .my-grid {
@apply grid row-gap-2;
grid-template:
'picture article' 300px
'ad article' auto
/ 300px 1fr;
}
.picture {
grid-area: picture;
}
.ad {
grid-area: ad;
}
.article {
grid-area: article;
}
.reversed-grid {
@apply grid row-gap-2;
grid-template:
'article picture' 300px
'article ad' auto
/ 1fr 300px;
} Like I said, might not be the answer to your exact situation, but it's at least one approach with grid, in the absence of a "reverse" option. |
Beta Was this translation helpful? Give feedback.
-
You can do that with https://play.tailwindcss.com/kWVynq6Scm I also have a plain css codepen of this from before Tailwind supported it https://codepen.io/henry/pen/poJVZer |
Beta Was this translation helpful? Give feedback.
-
Just add |
Beta Was this translation helpful? Give feedback.
-
You can use direction property to reverse a grid x-axis order. Nested elements will be reversed too so you have to make sure to add additional styles to fix this behavior. SkyWard Alpine |
Beta Was this translation helpful? Give feedback.
-
Hi there,
I'm using the grid class and grid-cols-2 and would like some control over the row order when the grid moves to single column on small screens (basically I need to reverse the row order on some rows). The equivalent of flex-row-reverse I guess.
Is this possible with grid or do I need to use flex?
Cheers
Stefan
Beta Was this translation helpful? Give feedback.
All reactions