
A daily tip on using CSS Grid! Created by @jensimmons
Joined May 2017
- Tweets25
- Following11
- Followers991
- Likes1
CSS Grid retweeted
Don’t assume creating a layout with Grid plus smart fallbacks is “twice as much work”. Turns out, it’s not.
Don’t assume creating a layout with Grid plus smart fallbacks is “twice as much work”. Turns out, it’s not.
CSS Grid retweeted
Using CSS Grid to implement the same old 12-column grid designs is like making a film with a steadycam — and always standing still.
Use Firefox to see your lines with the Grid Inspector in Dev Tools: 1) Inspect. 2) Find where it says display:grid. 3) Click the waffle icon
Add / subtract <li>s. See what happens. Add more `1fr`. See what happens. Add a `2fr`, or `1.5fr`. See what happens. You’re doing it!
Have you not tried CSS Grid yet? Do! Open codepen.io. Make a list. On the <ul>, apply `display:grid; grid-template-columns: 1fr 1fr 1fr;`
By explicitly placing items, you can tell the browser to lay things out in such a way that items overlap. Overlapping is *amazing*!
CSS Grid retweeted
No one is saying Thou Shalt Use CSS Grid. Especially not to ship the same old exact layouts. Let’s not get religious. Or anti-religious. / 6
CSS Grid retweeted
No reason to HAVE to use CSS Grid. No guilt. No pressure. It’s a new opportunity, not a mandate. You *can* get amazing new results. / 5
CSS Grid retweeted
…use CSS Grid to do something new. That isn’t possible without it. (With a simple fallback layout for browsers that don't support it.) / 4
CSS Grid retweeted
…make the time to learn Grid. Learn the code, or if you don’t code, learn the new mental model of what’s newly possible. And use it to… / 3
CSS Grid retweeted
…that’s the same, same mental model, same results, then use today’s tools. Nothing wrong w/that! At some point, take the time to learn… / 2
CSS Grid retweeted
This week, my best advice for using CSS Grid is this: it’s very different from the frameworks we’ve been using. If you want a tool that… / 1
Remember, use the Firefox Grid Inspector to help you see what you are building.
youtu.be/16enLRDbOyY?t=2m24s
CSS Grid is not the last or only CSS tool you will use for layout. It’s a piece of a larger puzzle — that includes Flexbox, Writing Modes…
Learning Grid is easier than learning Flexbox. There is more to learn, but it makes more sense. (Especially since we’ve been misusing Flexb)
`minmax()` is a fantastic new way to define sizes. Example: `minmax(150px, 350px)` means make this thing a minimum of 150px & maximum of 350
Don’t assume using CSS Grid is harder than a layout framework. Learning something new takes effort. But once you know Grid it’s much easier.
Either let the auto-placement algorithm place items — in which case you don’t need breakpoints. Or explicitly place items — and then you do.
