Search
Ahmad Shadeed: Use Cases For CSS fit-content
1.3.2022
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 …
Ahmad Shadeed: Use Cases For...
fit-content and fit-content()
20.5.2021
Here’s some hardcore deep-dive CSS nerdery from PPK. If you can wrap your mind around min-content (the smallest an element can be based on the content it contains) and max-content (the largest the content of an element can push it) …
The post fit-content and fit-content() appeared...
Accordion Rows in CSS Grid
23.7.2020
I’d bet grid-template-columns is used about 10× more than grid-template-rows, but maybe everyone has just been missing out. Eric Meyer chucks a bunch of row lines onto his main site layout grid like this:
grid-template-rows: repeat(7, min-content) 1fr repeat(3, min-content);
That way, if...
Little Tip: Draw Your Grid in ASCII in Your CSS Comments for Quick Reference
9.7.2018
Say you declared a grid like this:
body {
display: grid;
grid-template-columns: min-content 1fr;
grid-template-rows: min-content auto min-content;
}
This depends on content, for sure, but how it's likely to play out is like this:
+---+-------------+
| | |
|...