Technology News

iShadeed’s Container Queries Lab

Ahmad Shadeed got an early jump on container queries and has a growing collection of examples based on everyday patterns.

And, if you missed it, his latest post on container queries does a wonderful job covering how they work since landing in Chrome 105 this month (we’ll see them in Safari 16 soon). Some choice highlights and takeaways:

  • Containers are defined with the container-type property. Previous demos and proposals had been using contain instead.
  • Container queries are very much like the media queries we’ve been writing all along to target the viewport size. So, rather than something like @media (min-width: 600px) {}, we have @container (min-width: 600px) {}. That should make converting many of those media queries to container queries fairly straightfoward, minus the work of figuring out the new breakpoint values.
  • We can name containers to help distinguish them in our code (e.g. container-name: blockquote).

Great job, Ahmad! And thanks for sharing!

Direct Link →

Biden’s long game for American-made electric vehicles
Comparing JAWS, NVDA, and VoiceOver

Related Articles

The Self Provisioning Runtime

the-self-provisioning-runtime
If the Platonic ideal of Developer Experience is a world where you “Just Write Business Logic”, the logical endgame is a language+infrastructure combination that figures out everything else. Two paraphrases…

Fancy CSS Borders Using Masks

fancy-css-borders-using-masks
Have you ever tried to make CSS borders in a repeating zig-zag pattern? Like where a colored section of a website ends and another differently colored section begins — not…

Web Design Trends For 2022: Expert Opinions

web-design-trends-for-2022-expert-opinions
The world does not stand still and things change every year, if no color daily. There are new technologies, trends and growing interests in many areas. Design is no exception.…

Guide!

Guide!
When it comes to building websites there is probably some truth to the saying that you are only as good as the tools you have. Design experience and an ability…