CSS

Modern CSS Features Worth Using in 2026 (and What to Skip)

By Ken Key Feb 15, 2025 4 min read Updated Oct 16, 2026

Modern CSS Features Worth Using in 2026 (and What to Skip)
The short answer

The modern CSS worth using in 2026 is container queries, :has(), and native nesting, all now safe for production. Skip float layouts, clearfix hacks, and most media queries for component sizing. I still add fallbacks for newer color functions and anchor positioning until support widens.

Part of the complete web design guide.

On this page

CSS moves slower than JavaScript frameworks but it does move, and 2026 is a good year to clean out the hacks you’ve been carrying since 2019. Below is what’s genuinely ready for production, what still needs a fallback, and the older techniques you can safely retire. I’ve been shipping front-end work from Commack for a long time, and I only adopt a feature once it works in the browsers my clients’ customers actually use.

Container queries are the default now, not a novelty

Container queries landed in every major browser back in 2023, and by 2026 they’re the right tool for anything component-shaped. The mental shift is simple: instead of asking “how wide is the viewport,” you ask “how wide is the box I’m in.” That’s what you actually care about when a card sits in a sidebar on one page and a full-width grid on another.

.card-wrap {
 container-type: inline-size;
 container-name: card;
}

@container card (min-width: 400px) {
 .card {
 display: grid;
 grid-template-columns: 120px 1fr;
 gap: 1rem;
 }
}

If you’re still writing media queries to control a component’s internal layout, that’s the first thing to change this year. Media queries are for page-level layout. Containers are for everything inside it.

:has() killed a whole category of JavaScript

The :has() selector is supported everywhere now, and it removes a lot of “add a class when the input has a value” code from your bundle. It selects a parent based on what’s inside it, which CSS never used to be able to do.

/* Style the field label only when its input has content */
.field:has(input:not(:placeholder-shown)) label {
 transform: translateY(-1.4rem) scale(0.85);
 color: #2563eb;
}

/* Highlight a form group when any field inside is invalid */
.form-group:has(:user-invalid) {
 border-left: 3px solid #dc2626;
}

Note :user-invalid instead of :invalid. That distinction matters. :invalid fires on an empty required field the moment the page loads, which is a bad look. :user-invalid waits until the user has actually interacted and left the field, so you’re not yelling at someone before they’ve typed anything.

Native nesting: stop reaching for Sass for this

CSS nesting is stable and no longer needs a preprocessor. The one gotcha that trips people up is that a bare element selector inside a nested rule needs & if you want the descendant meaning, because plain element selectors now parse as relative.

.nav {
 display: flex;
 gap: 1.5rem;

 & a {
 color: inherit;
 text-decoration: none;
 }

 &:hover a:not(:hover) {
 opacity: 0.6;
 }

 @media (width < 40rem) {
 flex-direction: column;
 }
}

Modern Sass still earns its keep for mixins and loops, but if the only reason you have a build step is nesting, you can drop it and ship plain CSS. Fewer moving parts, faster builds, one less thing to break when a dependency goes sideways.

Logical properties and color, the quiet wins

Two things that don’t get enough attention. First, logical properties (margin-inline, padding-block, inset-inline-start) make right-to-left support and vertical writing modes work without a separate stylesheet. Second, modern color syntax gives you real control without hex math.

.button {
 padding-block: 0.75rem;
 padding-inline: 1.5rem;
 background: oklch(58% 0.18 255);
 border-radius: 0.5rem;
}

.button:hover {
 background: oklch(from var(--brand) calc(l - 0.08) c h);
}

oklch() is perceptually uniform, so darkening a color actually looks like darkening rather than shifting hue the way HSL sometimes does. The relative color syntax (from var(--brand)) lets you derive hover states from a single brand variable, which is a lot easier to maintain than a pile of hardcoded shades. Support is solid across current browsers.

What to skip, or use with a fallback

  • View transitions across full page navigations. Great for single-page apps, still uneven for multi-page sites depending on how your server is set up. Use them where they work, don’t architect around them yet.
  • Scroll-driven animations. Supported in Chromium, still not universal. Fine as progressive enhancement, not as your only way to reveal content.
  • Anchor positioning. Genuinely useful for tooltips and dropdowns, but check current support before you rip out your positioning library. This one is close, not done.
  • Any “new” feature you saw in a single demo. Test it in the browsers your analytics show. That’s the only benchmark that matters.

How this connects to real projects

None of this is trivia. Container queries and :has() mean less JavaScript, which means faster pages and fewer bugs. On client work, that translates directly into Core Web Vitals and how a site feels on a phone. If you’re weighing a rebuild and want someone to sort out which of these are worth adopting for your specific site, that’s the kind of thing I do as a Long Island web design practice. The answer is different for a marketing site than for a dashboard, and it’s worth getting specific rather than chasing whatever shipped last month.

FAQ

Do I still need a CSS preprocessor in 2026?

Not for nesting or variables, those are native now. Keep Sass if you rely on mixins, functions, or loops, or if your existing codebase is built on it. For a new project, plain modern CSS plus a bundler is usually enough.

Is it safe to use :has() in production?

Yes. It’s supported in all current major browsers. The main thing to watch is performance on very large DOMs with complex selectors, so keep your :has() usage scoped rather than writing something that scans the whole document on every change.

What should I replace media queries with?

Nothing wholesale. Keep media queries for page-level breakpoints and use container queries for component internals. The two work together, and mixing them up is where most layout bugs come from.

Have a project like this?

I do Long Island web design for Long Island businesses. If you need this done right, let’s talk.