Best Practices with CSS Grid Layout
smashingmagazine.com
smashingmagazine.com
I recommend watching last year's Morten's CSS grid presentation[1] as it has convinced me to stop using other layouts/frameworks and just embrace grid, which is truly amazing and it has been a blast working with it and making responsive websites without worrying too much about the markup.
Mobile OS browsers and IE 10 will get a usable experience that way without having to write flexbox fallbacks.
“Internet Explorer + CSS Grid????”
https://www.youtube.com/watch?v=7msERxu7ivg
MDN: Using feature queries
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_La...
well the original css grid spec actually did came from microsoft (https://www.w3.org/TR/2011/WD-css3-grid-layout-20110407/)
That's why it's only partial supported, they never updated it to the current version.
This is why CSS grids have been a nonstarter for most of us.
If your project's stakeholders are prepared to accept that IE 10/11 users won't see the same as Chrome users (I use, “in the same way that those on mobile won't see the same as those on desktop, older browsers such as IE 10 will also see a simpler layout”), then progressively enhancing a mobile layout with CSS Grid is a fine approach.
I accept that this can't always be the case, though. But I don't consider CSS Grid a non-starter for most sites. Browser support is now good enough that I look to use it wherever possible, and try to educate people still stuck in pixel-perfect across all devices -land.
> Is it still the case that one realistically needs to write their layout in flexbox as a fallback? Last I checked grid support was about 87% globally. I learned grid at one point but then just ignored it on the basis that if I had to write everything in flexbox already, why do both? Would love to know if this is a false assumption.
Here's a list of existing bugs that prevent me using it in production https://github.com/rachelandrew/gridbugs
Grid's fr (fractional) units also make the old percentage-based format for responsive sizing feel unwieldy in comparison.
This video might help show the difference (and all the Layout Land videos are great if you want to look more into CSS grid): https://www.youtube.com/watch?v=hs3piaN4b5I
display: flex; justify-content: center; align-items: center;
From quick googling of what CSS Grid Layout is, seems to be like we’re back to using tables, we just offload it to the style sheet.
I really wouldn't want to go back to even plain Flexbox now, let alone floating elements, tables, or any other layout system.
This doesn't suffer from the same problem.
<table> is a rigid display value taking up an entire tag. So the argument is why not push that into the CSS eg in a div instead and get rid of an entire unnecessary tag. This is why display:table doesn't get the same kind of hate thrown at it that <table> does.
Much like yield vs await in Python3 asyncio.
In the Python 2.7 days, people used generator functions to implement async in Python. When Python3 first came out, you couldn’t do both generator and async in the same function. I assume it’s because they used the same mechanism internally.
I think it was Python 3.5 which added support for async generators.
3.5 released true asnyc/await based on the `yield from` form and then 3.6 allowed for async generators.
You were close and your point remains. Although I don't think new tags are the right choice. I think HTML learnt a while ago that more tags doesn't solve everything.
I do really enjoy python async. It's cool to see a feature develop from a hack like that but a language first approach could have avoided some headaches. This is where Grid wins, it's a fresh take without requiring to maintain backwards compatibility with previous attempts.
For devs who don't care so much about accessibility, and are more just interested in getting the layout they want, I guess that argument may not resonate so much. I personally don't care much for taxonomic/teleological arguments around REST methods, but I'm a bit more willing to follow fashion with Grid if it means people on screen-readers will have a better time.
> seems to be like we’re back to using tables, we just offload it to the style sheet.
which solves exactly the issue that people were "bashing" about.