DEV Community

Joodi
Joodi

Posted on

10 1 1 1 1

Top 10 CSS Features You Can Use in 2025 (Fully Supported!)

Image description

CSS is growing fast, and 2025 is already full of awesome features that work in all major browsers. If you're into writing clean, modern, and powerful styles, these updates will make your day.


1. Scrollbar Gutter & Scrollbar Color

Image description

Usually, when scrollbars appear, your layout might jump. But with scrollbar-gutter, you can avoid that by reserving the space ahead of time.

.scrollable {
  scrollbar-gutter: stable both-edges;
}
Enter fullscreen mode Exit fullscreen mode

To match your design better, you can also color the scrollbar:

.scrollable {
  scrollbar-color: #444 #ccc;
}
Enter fullscreen mode Exit fullscreen mode

Why it's great

  • Keeps layouts stable even before scrolling.
  • Lets you style scrollbars to fit your theme.

2. ::target-text

Want users to spot the exact line a link jumped to? ::target-text highlights the specific text targeted by an anchor link.

::target-text {
  background: yellow;
  color: black;
}
Enter fullscreen mode Exit fullscreen mode

Why it's great

  • Makes long pages easier to navigate.
  • Highlights the user’s destination clearly.

3. Ruby Text Positioning

Languages like Japanese or Chinese often use small notes next to characters. ruby-align and ruby-position help with that.

ruby {
  ruby-align: center;
  ruby-position: over;
}
Enter fullscreen mode Exit fullscreen mode

Why it's great

  • Perfect for educational content or multilingual sites.
  • Cleanly positions annotation text.

4. Relative Color Syntax & light-dark()

Adjust a color’s saturation or lightness using the new relative color syntax. Combine that with light-dark() to switch between modes easily.

.element {
  background: light-dark(#fff, #000);
}
Enter fullscreen mode Exit fullscreen mode

Why it's great

  • Makes dark mode easier to manage.
  • Create smooth, color-based themes dynamically.

5. Native Accordions (Exclusive Panels)

You don’t need JavaScript to create one-at-a-time expanding sections. HTML’s <details> now supports exclusive mode:

<details name="faq">
  <summary>Question 1</summary>
  Answer here.
</details>
Enter fullscreen mode Exit fullscreen mode

Why it's great

  • Easy to build clean, accessible accordions.
  • No extra JS needed for toggling.

6. content-visibility

Skip rendering things that aren’t on screen yet with content-visibility. This improves performance on long or complex pages.

.lazy-load {
  content-visibility: auto;
}
Enter fullscreen mode Exit fullscreen mode

Why it's great

  • Speeds up initial load.
  • Especially useful for mobile or heavy pages.

7. font-size-adjust

Fonts may fall back if a custom one fails to load. font-size-adjust keeps the text readable and proportional.

.text {
  font-family: "MyFont", Arial, sans-serif;
  font-size-adjust: 0.5;
}
Enter fullscreen mode Exit fullscreen mode

Why it's great

  • Smooth fallback when fonts fail.
  • Maintains text alignment and legibility.

8. transition-behavior

Need more control over transitions? transition-behavior helps you reverse or fine-tune them—no JS required.

.card {
  transition: opacity 0.25s;
  transition-behavior: allow-discrete;
}
Enter fullscreen mode Exit fullscreen mode

Why it's great

  • Supports advanced UI animations.
  • Keeps interactions smooth and flexible.

9. @property & New Math Functions

Use @property to define CSS variables with specific rules and types. Also, use functions like round() or mod() to simplify calculations.

@property --progress {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}
Enter fullscreen mode Exit fullscreen mode

Why it's great

  • Lets you create powerful, typed CSS variables.
  • Reduces need for preprocessors or JS math.

10. offset-path & offset-position

Animate elements along a path—no JavaScript needed. Perfect for motion design or guiding the user's attention.

.animated {
  offset-path: path("M10,80 Q95,10 180,80");
  offset-position: 0%;
  transition: offset-position 2s ease;
}
Enter fullscreen mode Exit fullscreen mode

Why it's great

  • Animate naturally along curves.
  • Great for interactive UIs and creative effects.

Made with ❤️ for modern front-end developers.

I hope this was helpful, and I’d be happy to connect and follow each other!

Image of Datadog

Diagram Like A Pro

Bring your cloud architecture to life with expert tips from AWS and Datadog. In this ebook, AWS Solutions Architects Jason Mimick and James Wenzel reveal pro strategies for building clear, compelling diagrams that make an impact.

Get the Guide

Top comments (2)

Collapse
 
kevin_schmidt_ profile image
Kevin Schmidt

Great tips.

Collapse
 
joodi profile image
Joodi

Thanks! Glad you liked it 😊

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

👋 Kindness is contagious

Dive into this thoughtful article, cherished within the supportive DEV Community. Coders of every background are encouraged to share and grow our collective expertise.

A genuine "thank you" can brighten someone’s day—drop your appreciation in the comments below!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found value here? A quick thank you to the author makes a big difference.

Okay