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.