Ahmad Shadeed: Use Cases For CSS fit-content
March 1st, 2022
No comments
Ahmad Shadeed covers the CSS fit-content
sizing keyword. It’s useful! It just doesn’t come up super often. I find myself using min-content
a lot more, like when setting up the height of a grid-template-row
.
The fit-content
keyword is actually closely related to min-content
and max-content
— it just has a little heuristic it follows that Ahmad nicely illustrates as a flow chart.
My favorite use case is covered here: sizing a