SlideShare a Scribd company logo
What’s new in
Responsive Design
RACHEL ANDREW AT WEY WEY WEB. DECEMBER 2022
How do we support all these
different screen sizes?
What's new in Responsive Design - Rachel Andrew
Responsive Web Design
• Calculating percentages for floated layouts
• Squishing images
• Leaning on Media Queries
column-count: 3
Flexbox responds to
the content
display: flex
display: flex
What does it mean to respond
to content?
flex-basis: auto
max-content
flex-basis: auto
Space reduced from max-content until all boxes fit
We don’t have to line
everything up.
Sometimes what we need is just to make things fit nicely.
CSS Grid
For when you do want to line everything up.
.grid {
display: grid;
grid-template-columns: repeat(12, 1fr);
}
repeat(12, 1fr)
.grid {
display: grid;
grid-template-columns:
repeat(12, minmax(auto, 1fr));
}
repeat(12, 1fr)
.grid {
display: grid;
grid-template-columns:
repeat(12, minmax(0, 1fr));
}
repeat(12, minmax(0,1fr))
Responding to content in a grid
layout world
auto
grid-template-columns: repeat(3, auto)
justify-content: start
repeat(12, 1fr)
flex-basis: auto
repeat(3, 1fr)
min-content, max-content, fit-
content
Directing content-based sizing
repeat(3, min-content)
repeat(3, max-content)
repeat(3, fit-content(400px))
max-content 400px
.media {
display: grid;
grid-template-columns: fit-content(300px) 1fr;
gap: 20px;
}
What's new in Responsive Design - Rachel Andrew
Media Queries
column-width: 200px
flex-wrap: wrap
repeat(auto-fill, minmax(200px, 1fr)
The first rule of Media Queries
is …
Do I need a media query?
.wrapper {
display: grid;
grid-template-areas:
"hd"
"bd"
"sd"
"ft";
}
What's new in Responsive Design - Rachel Andrew
@media (min-width: 600px) {
.wrapper {
grid-template-columns: 3fr 1fr;
grid-template-areas:
"hd hd"
"bd sd"
"ft ft";
}
}
What's new in Responsive Design - Rachel Andrew
More than just screen size
What else could we respond to?
What type of pointer do I have?
@media (pointer:coarse) {
.pointer::before {
content: "You have a coarse pointer";
}
}
@media (pointer:fine) {
.pointer::before {
content: "You have a fine pointer";
}
}
Can I hover?
@media (hover) {
.can-i-hover::after {
content: "You look like you can hover.";
}
}
@media (hover:none) {
.can-i-hover::after {
content: "I don't think you can hover.";
}
}
Testing capabilities
Check for screen size, but also pointer type and hover ability to understand the
environment your site is being used in.
Responding to the wishes of the
visitor
Media Queries Level 5 and User Preference Media Features
prefers-reduced-motion
@media (prefers-reduced-motion: reduce) {
.animation {
animation: none;
}
}
New syntax for range media
queries
@media (min-width: 600px) {
.wrapper {
grid-template-columns: 3fr 1fr;
grid-template-areas:
"hd hd"
"bd sd"
"ft ft";
}
}
@media (width > 600px) {
.wrapper {
grid-template-columns: 3fr 1fr;
grid-template-areas:
"hd hd"
"bd sd"
"ft ft";
}
}
Container queries
.element {
container-type: inline-size;
}
.element {
container-type: inline-size;
container-name: sidebar;
}
@container (min-width: 500px) {
}
@container sidebar (min-width: 500px) {
}
What's new in Responsive Design - Rachel Andrew
Subgrid
.child-grid {
display: grid;
grid-template-columns: subgrid;
grid-template-rows: subgrid;
}
.main-grid {
display: grid;
grid-template-columns: repeat(12,1fr);
grid-template-rows: repeat(4, minmax(150px, auto));
}
.child-grid {
grid-column: 4 / 8;
grid-row: 2 / 4;
display: grid;
grid-template-columns: subgrid;
grid-template-rows: subgrid;
}
What's new in Responsive Design - Rachel Andrew
What's new in Responsive Design - Rachel Andrew
Subgrid + container queries
@container my-grid (min-width: 600px) {
.item {
display: grid;
grid-template-columns: subgrid;
}
}
What's new in Responsive Design - Rachel Andrew
What's new in Responsive Design - Rachel Andrew
:has()
li:has(h2) {
}
@container (min-width: 500px) {
.card:has(figure+.content) {
display: grid;
grid-template-columns: .8fr 1fr;
gap: 10px;
}
}
What's new in Responsive Design - Rachel Andrew
What does it mean to do
responsive design today?
Respond to content
Use new layout and image
features
Use media features and
container queries to enhance
your layout.
It’s not just about screen, or
even component, size
Responding to needs and
environment
Don’t expect people to fix
something to use your website.
Respond to meet them where
they are.
Thank you!
https://noti.st/rachelandrew

More Related Content

PDF
View Source London: Solving Layout Problems with CSS Grid & Friends
PDF
Solving Layout Problems With CSS Grid and Friends
PDF
Solving Layout Problems with CSS Grid & Friends - WEBU17
PDF
Solving Layout Problems with CSS Grid & Friends - NordicJS
PDF
404.ie: Solving Layout Problems with CSS Grid & Friends
PDF
Solving Layout Problems with CSS Grid & Friends - DevFest17
PPTX
Responsive Web Design & APEX Theme 25
PDF
Start Using CSS Grid Layout Today - RuhrJS
View Source London: Solving Layout Problems with CSS Grid & Friends
Solving Layout Problems With CSS Grid and Friends
Solving Layout Problems with CSS Grid & Friends - WEBU17
Solving Layout Problems with CSS Grid & Friends - NordicJS
404.ie: Solving Layout Problems with CSS Grid & Friends
Solving Layout Problems with CSS Grid & Friends - DevFest17
Responsive Web Design & APEX Theme 25
Start Using CSS Grid Layout Today - RuhrJS

Similar to What's new in Responsive Design - Rachel Andrew (20)

PDF
Into the Weeds of CSS Layout
PDF
Squishy pixels
PDF
Accelerated Stylesheets
PPTX
Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)
PPTX
Lect-4-Responsive-Web-06032024-082044am.pptx
PDF
How to matchMedia
PDF
Dynamic User Interfaces for Desktop and Mobile
PPTX
ResponsiveWebDesign
PDF
Intro to @viewport & other new Responsive Web Design CSS features
PDF
Making the most of New CSS Layout
PDF
The Creative New World of CSS
PPTX
Css responsive
PPTX
Digibury: Getting your web presence mobile ready - David Walker
PDF
Responsive Web Designed for your communication and marketing needs
PDF
New CSS Meets the Real World
PDF
Adaptive theming using compass susy grid
PDF
Supporting Middle-Out in CSS
PDF
Organize Your Website With Advanced CSS Tricks
PDF
GR8Conf 2011: Building Progressive UIs with Grails
Into the Weeds of CSS Layout
Squishy pixels
Accelerated Stylesheets
Responsive Web Design & APEX Theme 25 (OGh APEX World 2014)
Lect-4-Responsive-Web-06032024-082044am.pptx
How to matchMedia
Dynamic User Interfaces for Desktop and Mobile
ResponsiveWebDesign
Intro to @viewport & other new Responsive Web Design CSS features
Making the most of New CSS Layout
The Creative New World of CSS
Css responsive
Digibury: Getting your web presence mobile ready - David Walker
Responsive Web Designed for your communication and marketing needs
New CSS Meets the Real World
Adaptive theming using compass susy grid
Supporting Middle-Out in CSS
Organize Your Website With Advanced CSS Tricks
GR8Conf 2011: Building Progressive UIs with Grails
Ad

More from Wey Wey Web (20)

PDF
Portable, secure, and lightweight: Wasm runtimes and their use-cases - Natali...
PDF
Auditing Design Systems for Accessibility - Anna E. Cook
PDF
Adaptive Designs, Beyond Pixel Perfection - Stephanie Walter
PDF
Sharing is caring: what to know before you build a Research Repository - Juli...
PDF
Unlocking collaboration: A framework for developers and designers - Alicia Ca...
PDF
3 reasons to switch to OKLCH - Anton Lovchikov
PDF
ChatGPT and AI for web developers - Maximiliano Firtman
PDF
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
PDF
Form follows emotion - Isabella De Cuppis
PPTX
UX for emerging tech - Josephine Scholtes
PDF
Collaborative software with State Machines - Laura Kalbag
PDF
Lessons Learned from building Session Replay - Francesco Novy
PDF
Let's get visual. Visual testing in your project - Ramona Schwering
PDF
Solving Common Web Component Problems - Simon MacDonald
PDF
The Future is Malleable - Aleksandra Sikora
PDF
Trending tools & methodologies for UX - Josephine Scholtes.pdf
PDF
Decoding Web Accessibility through Testing - Anuradha Kumari
PDF
Good Security is one question away - Wiktoria Dalach
PDF
Dynamic CSS Secrets - Lea Verou
PDF
The Misty Report - Douglas Crockford
Portable, secure, and lightweight: Wasm runtimes and their use-cases - Natali...
Auditing Design Systems for Accessibility - Anna E. Cook
Adaptive Designs, Beyond Pixel Perfection - Stephanie Walter
Sharing is caring: what to know before you build a Research Repository - Juli...
Unlocking collaboration: A framework for developers and designers - Alicia Ca...
3 reasons to switch to OKLCH - Anton Lovchikov
ChatGPT and AI for web developers - Maximiliano Firtman
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
Form follows emotion - Isabella De Cuppis
UX for emerging tech - Josephine Scholtes
Collaborative software with State Machines - Laura Kalbag
Lessons Learned from building Session Replay - Francesco Novy
Let's get visual. Visual testing in your project - Ramona Schwering
Solving Common Web Component Problems - Simon MacDonald
The Future is Malleable - Aleksandra Sikora
Trending tools & methodologies for UX - Josephine Scholtes.pdf
Decoding Web Accessibility through Testing - Anuradha Kumari
Good Security is one question away - Wiktoria Dalach
Dynamic CSS Secrets - Lea Verou
The Misty Report - Douglas Crockford
Ad

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Machine Learning_overview_presentation.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Digital-Transformation-Roadmap-for-Companies.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
MYSQL Presentation for SQL database connectivity
Encapsulation_ Review paper, used for researhc scholars
Machine Learning_overview_presentation.pptx
Encapsulation theory and applications.pdf
Big Data Technologies - Introduction.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
20250228 LYD VKU AI Blended-Learning.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
SOPHOS-XG Firewall Administrator PPT.pptx
A comparative analysis of optical character recognition models for extracting...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Getting Started with Data Integration: FME Form 101
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

What's new in Responsive Design - Rachel Andrew