Chapter 1 deck Chapter 2 deck Chapter 3 deck Chapter 4 deck Chapter 5 deck Chapter 6 deck Chapter 7 deck Chapter 8 deck Chapter 9 deck Chapter 10 deck Chapter 11 deck Chapter 12 deck Chapter 13 deck Chapter 14 deck

Modern CSS 2025 & Summary

4 slides · use ←/→ or Space to navigate, F for fullscreen.

Reading view

← Back to the full Chapter 3 deck

Modern CSS 2025 & Summary
Fullscreen for presentation · Print / PDF for a handout
1 / 4
Lesson

Modern CSS 2025 & Summary

The newest CSS features and the key takeaways for writing modern, maintainable stylesheets.

Modern CSS 2025 & Summary

Modern CSS 2025

FeatureWhat it does
CSS NestingNative nesting — no Sass needed
Container QueriesRespond to the parent container's width
:has()The long-awaited parent selector
CSS Cascade Layers@layer for managing specificity
Scroll-driven animationsZero JavaScript
CSS Custom PropertiesDesign tokens
oklch()Wide-gamut perceptual colour
text-wrap: balanceSmart headings
Modern CSS 2025 & Summary

Key Takeaways

  • Separate style from content — use external CSS.
  • box-sizing: border-box — always reset it globally.
  • Use rem / em over px for scalable layouts.
  • Flexbox for 1D layouts, Grid for 2D layouts.
  • animation-fill-mode: both for smooth entry/exit.
  • steps() for sprite-sheet frame control.
  • Mobile-first with min-width media queries.
  • Validate at jigsaw.w3.org/css-validator.
Modern CSS 2025 & Summary

Activity — complete the code

Complete the three modern CSS 2025 features.

/* Parent selector */
div:(img) { border: 1px solid; }
 
/* Cascade layers */
@ reset, base, components;
 
/* Smart headings */
h1 { text-wrap: ; }