I often complain about stuff like this but the page is visible, it's the editable forms that you're expected to play with that are empty.
On topic: these are great. I am not sure why grid is one of the most useful, yet underutilized set of features in CSS. Could it have something to do with the fact that there are literally a 1000 ways to accomplish the same thing with it? It's been years since their introduction and I am still very much not comfortable and have to use MDN every time I have to do anything.
I suspect it has something to do with the state of the art at the time you initially learned CSS. Grid came so much later and superseded so much of what came before that it's basically likely throwing away everything we know and starting to learn from scratch.
Grid had a very awkward release / compatibility story so loads of devs who were looking for a good support story just used flexbox to accomplish what they needed to do and never learned grid. The zeitgeist of grid kind of ended before support hit acceptable levels, and grid is more or less just a syntactical wrapper around flex. The `gap` property is the real killer
I use flexbox extensively, but almost never use grid. I haven't taken the time to learn it and the API is not clear enough to pick it up intuitively. I might use it if I could read some type of primer on the basic concepts.
> I am not sure why grid is one of the most useful, yet underutilized set of features in CSS
First time I tried to use grid layout, we had to roll back the changes because it didn't work in IE11... now that IE11 support is being phased out in most places it might be more usable now?
I do agree that the grid stuff is a little too robust. I'm also finding myself looking it all up again every time I need to use it... but maybe I just don't have the muscle memory down yet like I do with flexbox.
Between last year and this year, our IE11 visitors shrank from a few percent (I think it was 5% during the week, under 1 on the weekend…) to under 1, and I got permission to kick IE11 support. Already implemented the first grid and can’t wait to use CSS variables. It’s like I suddenly landed in the future :)
IE11 supports CSS Grid... but an older version. I have to support IE11, and I uses CSS Grid. Not works out of the box on every case, and I need sometimes to write IE11 only media blocks to fix some details. CSS autoprefixer helps here a lot.
Same. I’ve been doing web dev since before FrontPage and I still have to Google a lot of CSS Grid properties. I don’t have an aversion to it, I just haven’t picked it up for some reason.
I think it has a lot to do with perceived browser support and lack of familiarity. Perhaps also a bit of CSS fatigue: “I just learned flex bix and that’s good enough.”
You're not alone. Flex and grid are so complex you need to be full-time front-end to master them. The old complexity has been replaced by something even more complex.
The "1-line" is referring to the one line doing most/all the hard work in each example. Though I do agree - seems like they wrote the title before the article here.
The text makes it fairly clear that there is one particular line of code that each slightly longer example is showing off. The one line of interest is highlighted at the top of each example.
Remember that a user may want to print the shopping cart content, receipts, or nearly anything on the page. This is especially common for the non-technical folks or the ones with poor connection.
The CSS grid still works worse with the printing page breaks than the tricks with the floats and margins.
I've been using CSS since it first [barely] appeared in IE3, but I've been behind on fully getting to know flex and grid. Didn't know about aspect-ratio at all.
Maybe that says more about the amount of attention I've been paying, but I learned a lot from these examples.
Or you could lean on auto placement more heavily: in the original code, the left/main/right grid-column declarations are superfluous, and `1 / -1` is arguably clearer than `1 / 4` for the header and footer:
.ex5 .parent {
display: grid;
grid-template: auto 1fr auto / auto 1fr auto;
}
.ex5 header,
.ex5 footer {
grid-column: 1 / -1;
}
In case of Sciter, single property flow and flex units define everything that flexbox and grid can do with 20+ properties. And note: flexbox breaks existing CSS box model, flow/flex units - do not.
I watched a YouTube video by Una Kravets, and was led to this page from there.
All the techniques revolve around the flexbox and grid selectors. In that sense, it is a good starting point (or at least, was) for a CSS developer wanting to have the latest tricks in his arsenal.
Because some of us started out in the nineties and like to get a quick update on what is possible in case we need it somewhere and web design isn't our main responsibility.
In fact, the single most important resource I wish for of this kind, would be a reference page that shows all common layouts and tech-stack agnostic examples of popups, overlays, off-canvas sidebars and such using the most up-to-date implementation so we wouldn't have to include a huge CSS framework for something that's a few lines of modern CSS supported by evergreen browsers.
CSS display: grid existed since 2007, flex since 2009. If people are not using box model with CSS, I wonder how they are using it. Box model of CSS is "hello world" of python.
I said I didn't mean to be cocky. It just makes me think people don't even touch CSS because if I publish an article saying "this is how you print hello world in C" people wouldn't care.
Between 2007 and 2009, Internet Explorer 6 was still a thing. It was incredibly daring on YouTube’s part to put up a “Internet Explorer is deprecated” banner back in 2009; it had to be done without official approval. [1]
In 2011, “display: table” was cutting edge; we finally had few enough IE6 and IE7 users that it was practical to pull off, albeit with “<!--[if IE lt 8]><table><tr><td><![endif]-->” hacks.
I still had to deal with IE-specific bugs like the fact webfonts didn’t work in IE8 when put in an IFRAME — but did work in IE9 when rendering in IE8 mode. This wasn’t limited to IE: Safari had a bug where you couldn’t legibly print a page with webfonts on them, requiring a Safari-specific hack to disable webfonts in the print CSS.
Professional web developers were not using stuff like “display: flex” or “display: grid” in production until the late 2010s, when Edge and Chrome was finally reducing the number of Internet Explorer uses to a sane level.
These two only existed theoretically. For anyone actually earning a living with the frontend they didn't exist because:
- grid kinda existed in IE, but not in other browsers. Well, you could build a site that only targeted IE, but in 2007 this was already being really frowned upon and out of vogue.
When grid was finalized, it was a different version of the spec, not entirey compatible with IE's. Chrome and Firefox only got grid in 2017.
- flex was only partially supported by browsers until 2012 when it was fully supported, but behind a prefix. Full support without a prefix only appeared in 2013.
I mean, I love the fantasy world you have constructed, but there are people who actualy do frontend and do actually remember the anciaent histroy of checks notes the past 10 years or so
From where I sit, here in late 2021 it has just become finally possible to use “Display: Grid” [1] on a real world site. Microsoft has finally configured IE11 to force a website to open up in Edge if the patched IE11 decides the site is not IE compatible; I just need to learn how to make my site refuse to open in IE11 (opening up in Edge instead) to use “Display: Grid”.
I really wish Display: Grid was practical to use back in 2009. It would had been a lot more straightforward than the “Display: Table” stuff I did instead.
https://flexboxfroggy.com/
https://cssgridgarden.com/