Archive For July 24, 2017
Earlier this year, support for CSS grid layout1 landed in most major desktop browsers. Naturally, the specification is one of the hot topics at meet-ups and conferences. After having some conversations about grid and progressive enhancement, I believe that there’s a good amount of uncertainty about using it. I heard some quite interesting questions and statements, which I want to address in this post.
Statements And Questions I’ve Heard In The Last Few Weeks Link
- “When can I start using CSS grid layout?”
- “Too bad that it’ll take some more years before we can use grid in production.”
- “Do I need Modernizr in order to make websites with CSS grid layout?”
- “If I wanted to use grid today, I’d have to build two to three versions of my website.”
- “Progressive enhancement sounds great in theory, but I don’t think it’s possible to implement in real projects.”
- “How much does progressive enhancement cost?”
These are all good questions, and not all of them are easy to answer, but I’m happy to share my approach. The CSS grid layout module is one of the most exciting developments since responsive design. We should try to get the best out of it as soon as possible, if it makes sense for us and our projects.
Demo: Progressively Enhanced Layout Link
Disclaimer: It would be best to open the demo on a device with a large screen. You won’t see anything of significance on a smartphone.
When you open the demo42, you’ll find yourself on the home page of a website with a very basic layout. You can adjust the slider in the top left to enhance the experience. The layout switches from being very basic to being a float-based layout to being a flexbox layout and, finally, to being one that uses grid.
It’s not the most beautiful or complex design, but it’s good enough to demonstrate which shapes a website can take based on a browser’s capabilities.
This demo page is built with CSS grid layout and doesn’t use any prefixed properties or polyfills. It’s accessible and usable for users in Internet Explorer (IE) 8, Opera Mini in Extreme mode, UC Browser and, of course, the most popular modern browsers. You can perfectly use CSS grid layout today if you don’t expect exactly the same appearance in every single browser, which isn’t possible to achieve nowadays anyway. I’m well aware that this decision isn’t always up to us developers, but I believe that our clients are willing to accept those differences if they understand the benefits (future-proof design, better accessibility and better performance). On top of that, I believe that our clients and users have — thanks to responsive design — already learned that websites don’t look the same in every device and browser.
In the following sections, I’m going to show you how I built parts of the demo and why some things just work out of the box.
CSS Grid Layout And Progressive Enhancement Link
Let’s take a deeper look at how I built the “four levels of enhancement” component in the center of the page.
I started off by putting all items into a
section in a logical order. The first item in the section is the heading, followed by four subsections. Assuming that they represent separate blog posts, I wrapped each of them in an
article tag. Each article consists of a heading (
h3) and a linked image. I used the
picture element here because I want to serve users with a different image if the viewport is wide enough. Here, we already have the first example of good ol’ progressive enhancement in action. If the browser doesn’t understand
source, it will still show the
img, which is also a child of the
<section> <h2>Four levels of enhancement</h2> <article><h3>No Positioning</h3><a href="#"> <picture> <source srcset="320_480.jpg" media="(min-width: 600px)"> <img src="480_320.jpg" alt="image description"> </picture></a> </article> </section>
Float Enhancements Link
On larger screens, this component works best if all items are laid out next to each other. In order to achieve that for browsers that don’t understand flexbox or grid, I float them, give them a size and some margin, and clear the floating after the last floated item.
Apple iOS 10.3.3 has problems but what appears to be an otherwise dull update on the surface, actually hides a crucial improvement (but bad news for older iPhones) if you delve deeper…
‘Great Secret Features’ and ‘Nasty Surprises’ are my regular columns investigating operating system updates for the best features / biggest problems hidden behind the headlines.
Buried deep in Apple’s official iOS 10.3.3 security notes is something startling: iPhones have been vulnerable to hackers taking complete control of them simply via WiFi. The hack, dubbed ‘Broadpwn’, stems from Broadcom WiFi chips (model numbers BCM4354, 4358 and 4359) built into the vast majority of iPhones (Intel chips exist in some iPhone 7 and iPhone 7 Plus variants).
Samsung is clearly excited about its (eye wateringly expensive) Galaxy Note 8. Earlier this month the company ‘accidentally’ leaked it and now Samsung has gone a step further and officially promoted its massive size and new design…
This details came this week when the company sent out official press launch invites for its latest and, arguably, most important smartphone to date. But more importantly Samsung chose to give away two of the handset’s biggest talking points.Concept Creator
Galaxy Note 8 based on multiple leaks
We know that it’s been tough lately to try and find a Nintendo Switch on store shelves, despite a recently replenishment by some GameStop locations. But if you think it’s tough here, you ought to try Japan.
That’s just what Nintendo Life did, setting out on a quest to try and track down a Nintendo Switch console in the land of the Rising Sun last week when Splatoon 2 hit shelves. And did it have any luck? Well…
Its first stop was a few stores in the suburbs, with a lot of stores noting that there is no new stock on the system, and, more importantly, they didn’t know when they would be getting more in stock.
A lot of people just want to preorder a damn SNES Classic. But nothing’s ever easy with Nintendo
The SNES Classic isn’t scheduled to come out for another few months but everyone is already furiously trying secure a preorder. As a result, when Walmart appeared be accepting them late Friday night, people swamped the site trying to lock one of the mini retro consoles down. Those of us who were asleep at the time, or working a late shift, got back to our computers hours later only to see we had missed the small window of opportunity completely
Legendary Raids have finally arrived in Pokémon GO, flying out to the world at large after a confusing but oddly successful reveal at Pokémon GO Fest in Chicago. First up are Lugia and Articuno, two capable contenders that will take some doing to fight. But the name of this game, as we all know, is to catch ’em all. So here’s how you’ll want to go about finding, fighting and beating Articuno and Lugia.
Finding a Legendary Raid is pretty much the same as finding a normal one: the raids that you’re interested in are indicated by five little Rhydon icons, and you’re guaranteed either a Lugia or an Articuno if you see one of those eggs. You can either check gyms around you, or see if your area has a tool like this one to search wider. It’s worth noting that for right now, the concept of a Legendary Raid Pass does not appear to have made its way into the game. Legendary Raids work much like normal Raids in this regard: you just need to find the raid and spend a standard pass to get in .