Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4] .grid.grid-rows-0 is invalid #16012

Closed
lko3001 opened this issue Jan 29, 2025 · 4 comments · Fixed by #16020
Closed

[v4] .grid.grid-rows-0 is invalid #16012

lko3001 opened this issue Jan 29, 2025 · 4 comments · Fixed by #16020

Comments

@lko3001
Copy link

lko3001 commented Jan 29, 2025

I tested the snippet even in the playground: https://play.tailwindcss.com/MaCezE0SuO
As you can see when you type "grid-rows-0" it gives you:

grid-template-rows:  repeat(0, minmax(0, 1fr))

Which is invalid. I think it should be instead set to grid-template-rows: 0fr. I know it's available by doing grid-rows-[0fr] but I think it should happen even if you only say grid-rows-0

@RobinMalfait
Copy link
Member

Hey!

While I agree and can see that this is invalid, I wonder what a use case is for setting a grid to 0 rows 🤔

Another trick you can use is grid-rows-none which looks like it has the same effect as grid-rows-[0fr].

I would recommend to use grid-rows-none instead, but I'm still curious to know what the 0fr is used for.

@adamwathan
Copy link
Member

I think internally we should just validate that value is > 0 and throw grid-rows-0 out personally. Can use grid-rows-[0fr] to get that specific output, to me that's not what grid-rows-0 really implies, it's for setting the number of rows and 0fr is one row that is 0fr in size, not zero rows.

@RobinMalfait
Copy link
Member

This is now fixed via #16020 such that grid-rows-0 and grid-cols-0 won't be generated anymore. 💪

@lko3001
Copy link
Author

lko3001 commented Jan 29, 2025

I agree that grid-rows-0 is not for setting "zero rows", but sometimes it's needed in certain use cases, for example, for accordions, it might be useful. Sure, now we can transition from height: 0 to height: auto but I'd have left it. Because you can't transition from grid-template-rows: none to a fr value. And the accordion is the only example that I can think of where it might be useful, but maybe there are more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants