Scroll-Driven Animations
The biggest CSS animation feature in years. animation-timeline: scroll() and animation-timeline: view() let you tie CSS animations to scroll progress โ no JavaScript needed. Elements can animate as they enter the viewport, progress bars can track scroll position, and parallax effects become pure CSS.
/* Fade in as element enters viewport */
.reveal {
animation: fadeIn linear both;
animation-timeline: view();
animation-range: entry 0% entry 100%;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(40px); }
to { opacity: 1; transform: translateY(0); }
}
/* Progress bar tied to page scroll */
.progress-bar {
animation: grow linear;
animation-timeline: scroll();
}
@keyframes grow {
from { transform: scaleX(0); }
to { transform: scaleX(1); }
}
Browser support is strong: Chrome 115+, Edge 115+, and Firefox 110+. Safari added support in version 18. This replaces entire JavaScript libraries (Intersection Observer + animation code) with just a few lines of CSS.
Container Queries
Container queries let a component adapt its layout based on its parent container's size, not the viewport. This is a fundamental shift in responsive design โ components become truly portable, adapting to wherever they're placed:
.card-wrapper {
container-type: inline-size;
container-name: card;
}
/* Card adapts to its container, not the viewport */
@container card (min-width: 400px) {
.card {
display: grid;
grid-template-columns: 200px 1fr;
}
}
@container card (max-width: 399px) {
.card {
display: flex;
flex-direction: column;
}
}
Container queries are supported in Chrome 105+, Safari 16+, Firefox 110+, and Edge 105+. They work perfectly alongside traditional media queries โ use media queries for page-level breakpoints and container queries for component-level responsiveness.
View Transitions API
The View Transitions API brings smooth, animated transitions between page states or even between pages in multi-page applications. What previously required complex JavaScript animation libraries is now achievable with minimal code:
/* JavaScript: trigger a view transition */
document.startViewTransition(() => {
updateDOM(); // your state change
});
/* CSS: customize the transition */
::view-transition-old(root) {
animation: fade-out 0.3s ease;
}
::view-transition-new(root) {
animation: fade-in 0.3s ease;
}
/* Named transitions for specific elements */
.hero-image {
view-transition-name: hero;
}
::view-transition-group(hero) {
animation-duration: 0.4s;
}
New Color Spaces
CSS now supports wide-gamut color spaces that can express millions more colors than the traditional sRGB space. The oklch() function is emerging as the recommended default for new projects:
/* oklch(lightness, chroma, hue) */
:root {
--primary: oklch(0.65 0.25 275); /* vivid purple */
--secondary: oklch(0.70 0.22 340); /* vibrant pink */
--success: oklch(0.72 0.20 145); /* rich green */
}
/* Consistent lightness across hues */
/* (something RGB can't guarantee) */
--blue: oklch(0.65 0.25 265);
--green: oklch(0.65 0.25 145);
--red: oklch(0.65 0.25 25);
/* All three feel equally "bright" */
The advantage of OKLCH over hex/RGB: perceptual uniformity. Changing the hue channel while keeping lightness and chroma constant produces colors that genuinely look equally bright โ something impossible in RGB.
Native CSS Nesting
One of the most-requested CSS features is finally here. Native nesting works in all major browsers and eliminates a major reason developers reached for preprocessors:
.card {
background: var(--surface);
border-radius: 16px;
padding: 24px;
h3 {
font-size: 1.1rem;
margin-bottom: 8px;
}
p {
color: var(--muted);
font-size: 0.85rem;
}
&:hover {
border-color: var(--accent);
transform: translateY(-2px);
}
@media (max-width: 768px) {
padding: 16px;
}
}
Visual Design Trends
Beyond the technical features, several visual design trends are defining 2025:
- Bento grid layouts: Inspired by Apple's product pages, asymmetric card grids with varied sizes are everywhere โ from dashboards to landing pages.
- Layered depth: Combining glassmorphism, subtle shadows, and overlapping elements to create rich, three-dimensional interfaces.
- Micro-interactions: Small, delightful animations on hover, focus, and state changes. The scroll-driven animations API makes these much easier to implement.
- Variable fonts: Using a single variable font file with adjustable weight, width, and slant for dynamic typography that responds to context.
- Dark mode as default: More sites are shipping dark-first, with light mode as the alternative. This pairs well with the vibrant colors available in new color spaces.
- AI-aware interfaces: Streaming text, thinking indicators, and progressive disclosure patterns for AI-powered features are becoming common UI patterns.
Start Building Modern CSS
Put these trends into practice with our free CSS generators. Create gradients, shadows, and glass effects instantly.
Explore All Tools โ