3 ms·
A Complete Guide to CSS Grid
- _greim_ 3y agoI have this bookmarked and have been using it for approximately the last five years. There's a similar one for flexbox [1]. [1] https://css-tricks.com/snippets/css/a-guide-to-flexbox/ https://css-tricks.com/snippets/css/a-guide-to-flexbox/
- mordechai9000 3y agoYeah, this is the one I pull up when I need a reference or a quick refresher. When it's been awhile, I play quick run through of the grid garden game: https://cssgridgarden.com/ https://cssgridgarden.com/
- isodev 3y agoSame! I even have them framed behind my screen where I can peek from time to time. Even after so many years, I can't remember which ones are "justify" and which ones are "align", lol.
- dugmartin 3y agoI normally just set display: flex on an element and then use Chrome’s dev tools. You can click on an icon next to the declaration and it brings up a UI with all the flex alignment properties.
- wruza 3y agoThese two are the ones I refer to every time when I have to decide which of the {justify,align}-{items,content} naming disaster to use. Pretty sure this is the main reason these are so popular.
- _greim_ 3y agoGlad to hear I'm not the only one who forgets what those things are called! There was a time when CSS fit in my head, but those days are gone.
- ChrisArchitect 3y agoRelated: An Interactive Guide to CSS Grid https://news.ycombinator.com/item?id=38388842 https://news.ycombinator.com/item?id=38388842
- icpmacdo 3y agoThere is a great Hacker News comment from this year out there somewhere explaining exactly where the complexity in CSS comes from, if only I can find it again.
- davnicwil 3y agounanticipated usecases?
- throwaway14356 3y agoi bet it has interesting and insightful comments
- rendall 3y agoIs it that CSS is complicated because the problem it solves is complicated?
- sidlls 3y agoThe problem of layout is not nearly as complicated as the spaghetti mess of code presented in this article implies.
- wruza 3y agoIsn’t it self-imposed complexity most of the time?
- rendall 3y agoNot sure what you mean. The problem set of machine layout across devices and designs is vast and complicated. There are simpler solutions sets, or solutions that simplify by limiting options, but I'm a staunch defender of CSS as an adequate, even elegant, solution to the entire problem. Again, I believe that CSS is complicated because the problem it attempts to solve is complicated. Every solution that is presented as simpler is simpler because it limits options.
- 3y ago
- adeptima 3y agoIMHO The best An Interactive Guides Flexbox https://www.joshwcomeau.com/css/interactive-guide-to-flexbox/ https://www.joshwcomeau.com/css/interactive-guide-to-flexbox... Grid https://www.joshwcomeau.com/css/interactive-guide-to-grid/ https://www.joshwcomeau.com/css/interactive-guide-to-grid/
- fullofdev 3y agoIt's fun to see css-tricks again here. After the ...
- zhirzh 3y agoA-Z list of css guides by css-tricks.com https://css-tricks.com/almanac https://css-tricks.com/almanac
- deleted 3y ago[deleted]
- tracyhenry 3y agoI thought everyone was using flexboxes. In what cases would a grid be preferable?
- mokkol 3y agoFlex for one dimension and grid for 2 dimensions.
- vekker 3y agoYou'd think one could think of simpler & more intuitive naming of CSS properties for layouts. I've used CSS for many years, but somehow I still have to look up basic property names & values from time to time. I don't really have this issue with programming languages. And I find it easier to memorize Tailwind classes for some reason.
- chaz6 3y agoIt makes it sound so simple, but it seems predicated on having a fixed viewport. What happens when I resize my browser screen, or I am viewing on mobile? It is not clear how to make the layout adapt to a portrait, square or landscape orientations.
- ncjcuccy6 3y agoMedia queries and different grid layouts. It's a lot easier than flex when it comes to responsivitiy.