2023 Safari & Web
WWDC23 · 35 min · Safari & Web
What’s new in CSS
Explore the latest advancements in CSS. Learn techniques and best practices for working with wide-gamut color, creating gorgeous typography, and writing simple and robust code. We’ll also peer into the future and preview upcoming layout and typography features.
Watch at developer.apple.com ↗Code shown on screen · 5 snippets
Masonry layout, example 1
main {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
grid-template-rows: masonry;
} Masonry layout, example 2
main {
display: grid;
grid-template-columns: 1fr 2fr 3fr;
grid-template-rows: masonry;
} Masonry layout, example 3
main {
display: grid;
grid-template-columns: 10rem 1fr minmax(100px, 300px);
grid-template-rows: masonry;
} Margin trim
.card {
background-color: #fcf5e7;
padding: 2rlh;
margin-trim: block;
}
h2, p {
margin: 1rlh 0;
} Color gamut media query
.card {
background-color: #fcf5e7;
padding: 2rlh;
margin-trim: block;
}
h2, p {
margin: 1rlh 0;
} Resources
Related sessions
-
28 min -
16 min -
22 min -
21 min -
16 min -
32 min