Urgent.News

What's breaking now, across thousands of outlets.

Tech

CSS :open Is Baseline 2026: Style Open UI States with One Selector

Web interfaces contain several elements that can be open or closed: disclosure widgets, dialogs, select pickers, date inputs, and color pickers. Historically, styling those states required different selectors. A disclosure could use details[open] , while native picker state often had no equivalent general selector. The CSS :open pseudo-class provides one semantic selector for elements that are…

The CSS :open pseudo-class now provides a single semantic selector to style elements in an open state, such as disclosure widgets, dialogs, select pickers, date inputs, and color pickers. Introduced in May 2026 and supported across the latest browser versions, :open simplifies styling by eliminating the need for multiple selectors.

For instance, the details element can be styled with details :open summary { background: #eef2ff; }, while native pickers benefit from select :open { border-color: #4f46e5; }. Combining :open with :has() enhances its utility, as seen with .field :has (select :open) { background: #f8fafc; }. However, :open does not guarantee visibility or interactivity, so it should not replace accessibility considerations.

Feature detection with @supports selector(:open) is recommended for isolated styling. When used thoughtfully with appropriate fallbacks, :open enhances CSS without compromising accessibility, offering a semantic approach to reveal a control's active state.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

There is no free lunch, especially in app publishing

2009, mobile networks class. We were studying how TCP handles packets lost over 3G: the network detects the loss, replays the packet, and the transfer survives a radio link that drops things all the…

  • "There is no free lunch" principle applies to app publishing, just like in TCP reliability costs.
  • Free tiers end right before App Store and Google Play, revealing hidden pricing tables.
  • GoodBarber offers 30-day free platform with PWA, no hidden costs after trial.

More from Tuesday 1 September →