Is there any way with CSS grid to say "all rows should have size 'auto', except the last one which should be '1fr'" while relying on implicit rows?

I want every row as short as possible, with the last row taking up the rest of the space, but with an unknown number of rows πŸ€”
The image above is the outcome I want, but I don't want to have to use `grid-template-rows: auto auto 1fr`, because that breaks if I need another row. Any way to do it without knowing the number of rows?
Put another way, it's easy to make the first row different than the rest:

grid-template-rows: 1fr;
grid-auto-rows: auto;

But how can you make the _last_ row different than the rest?
Experimenting with an API in Tailwind to handle this case but nervous it might be a bit too specific πŸ€”

`row-pack-start` = Dump any extra space in the last row
`row-pack-end` = Dump any extra space in the first row

play.tailwindcss.com/t0xmVP8HjA?fil…

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Adam Wathan

Adam Wathan Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @adamwathan

3 Jul
Building really great stuff takes a lot more time, attention, and focus than is really possible to understand up front.

It's hard but I've had to learn to say no to even my own best ideas if they mean spinning another plate, or I eventually resent them for getting in the way.
If you want to do a lot of things, focus on things that can be finished.

Write a book, record an album, organize an event, produce a video, give a talk β€” you can build a rich catalog of work if you are deliberate about doing things that can actually be *done*.
But if you want to do things that can't really be finished (like software), I think the right way to be ambitious is to focus on one thing and make it great.

The sacrifice of saying no to a few fun ideas is not as bad as the sacrifice of never feeling awesome about your work.
Read 7 tweets
10 Jun
Fun piece of history β€” here's the first open source code I ever wrote, way back in 2010 πŸ™ˆ

github.com/reaper-oss/sws…

It's a set of extensions for REAPER (DAW software) for editing live drum performances super efficiently + a bunch of other productivity helpers.
Although I'd been programming in some capacity since I was 10-11 and had good exposure to basic concepts like variables, loops, etc., I had no idea that "software design" was a concept, and it never even occurred to me that code could have "quality" πŸ˜…
I just had a bunch of feature ideas and had been messing around with some Python scripts, when Tim (the author of the bigger project) saw potential in me, took me under his wing in IRC, taught me C++, and created this stupid `Adam.cpp` file for me to go nuts in ❀️
Read 8 tweets
31 May
πŸ€” What's the best way to structure your classes and markup when building UIs with Tailwind CSS?

Here are some of the rules I follow to build things that are consistent, easy to understand, and straightforward to componentize πŸ‘‡ Image
Sort classes generally from the outside in (in terms of the box model) putting things that affect layout before things that don't, while also trying to group related classes.

This lets you see the things that are going to have the biggest impact quickly. Image
☝️This is a bit of an art, but hoping to automate in the near future!

I've been working on nailing the recommended class order a bit lately β€” check out my list so far on GitHub:

github.com/tailwindlabs/t…

(Inspired by @mdo's advice on Code Guide! πŸ™)
Read 14 tweets
28 Jan
This is my favorite HN thread in a long time, so (positively) surprised at the support in the comments:

news.ycombinator.com/item?id=259401…

Maintaining open-source is brutal, and feeling obligated to acknowledge, review, and respond to every attempt to contribute is a huge burden to carry.
When I saw this tweet from @dhh the other day I couldn't help but s/email/open source contribution/, but it makes me feel horribly guilty to suggest that anyone should feel anything but grateful for unsolicited free work from contributors.

But the reality is even though folks are generally trying to help by contributing, those contributions still cost the maintainer more than they cost the contributor, in terms of time to review, stress worrying about making time to review, and long term maintenance.
Read 9 tweets
16 Jan
This is a great example of why you need more control when implementing dark mode than just reversing the color scheme or overriding basic variables like "--color-primary" or similar.

Short thread pointing out some of the neat design decisions here πŸ‘‰
1. The top banner – the background color changes a bit and so does the link, but it doesn't *invert*, it's still light on dark in both versions.

Dark sections shouldn't be inverted to light in dark mode, you'd get a blinding light block β€” bad in dark environments.
2. The background switches from light to dark, but in the light design it's a solid color, and in the dark design it's a gradient. You can't do this by changing a color variable.
Read 7 tweets
18 Nov 20
Huge props to the team that made this Tailwind CSS v2.0 launch possible πŸ‘‰ (thread)

tailwindcss.com
.@bradlc who built the entire website. I absolutely did not expect us to have time for all the insane interactions and animations. He managed to do everything I ever dreamed of plus more, and the APIs he created for it are a delight to work with.
.@malfaitrobin who worked side-by-side with me to develop all of the new features in Tailwind CSS v2.0, and took on the massive job of updating Tailwind UI to take advantage of all the new features. He built an entire automated system that can idempotently update our templates 🀯 Image
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(