The State of Modern CSS: Tooltips, Native Geolocation Elements, and Cutting-Edge Selectors

Editorial Note: Welcome to a brand-new edition of "What’s !important" (#18), your definitive guide to the bleeding edge of CSS and front-end web development. Over the past few weeks, the web development community has delivered a torrent of innovative techniques, proposed specifications, and native browser features that are reshaping how we build user interfaces.


Main Facts

The front-end ecosystem is experiencing a major architectural shift toward native browser capabilities that previously required heavy JavaScript libraries or complex, brittle workarounds. Key developments highlighted in this cycle include:

  • Intelligent Tooltips: Moving beyond basic hover states to "delayed-then-instant" tooltips using modern CSS properties like interest-delay-start and interest-delay-end.
  • The <geolocation> HTML Element: A native element designed to simplify location requests, paired with progressive enhancement strategies to bridge the gap in cross-browser support.
  • MicroLighter & The Custom Highlight API: A lightweight syntax highlighter leveraging the native ::highlight() API for superior performance over DOM-heavy alternatives.
  • Grid-to-Variable Data Flow: Innovative techniques by Temani Afif for extracting CSS grid row/column counts and cell coordinates into CSS custom properties.
  • Next-Generation Selectors and Functions: The introduction of proposals for the class prefix selector (.something-*) and the new @supports named-feature() function for feature-detecting previously undetectable behaviors.
  • Balanced Flexbox Layouts: The arrival of flex-wrap: balance in Chrome, bringing text-balancing logic natively to multi-row flex containers.

Chronology of Recent Developments

The past several weeks have seen a rapid succession of thought-leading articles, specification proposals, and browser updates.

Phase 1: Refining Micro-Interactions (Tooltips)

The conversation kicked off with Abhishek Jakhar tackling a persistent UX annoyance: accidental tooltip triggers and sluggish dismissals. Jakhar detailed a pattern where tooltips should feature an intentional delay before appearing, but disappear instantly once the user moves away.

Shortly after, Chris Coyier expanded on this by publishing a modern implementation leveraging browser "interest invokers." Utilizing the emerging CSS properties interest-delay-start and interest-delay-end, this approach modernizes how browsers track user intent. While currently limited to Chrome, it provides an ideal blueprint for progressive enhancement.

Phase 2: Native HTML Enhancements and APIs

As developers push the boundaries of HTML and CSS, new native elements have taken center stage. The introduction of the <geolocation> element aims to tame the notoriously complex Geolocation API—a system historically plagued by hardware-dependent latency and frustrating permission-state management.

Concurrently, Dave Rupert introduced MicroLighter, a minimal syntax highlighter built on top of the native Custom Highlight API. By bypassing heavy DOM manipulation, MicroLighter showcases the immense performance gains possible when developers lean directly on browser-native highlighting primitives.

What’s !important #18: <geolocation>, Syntax ::highlight()ing, named-feature(), and More | CSS-Tricks

Phase 3: Advanced Layout and Selectors

Midway through the cycle, layout engineering took the spotlight. Temani Afif unlocked new possibilities by demonstrating how developers can pipe CSS grid metrics—such as row/column counts and specific cell index coordinates—directly into CSS custom properties. This breakthrough immediately enabled advanced patterns like proximity-based hover states.

Simultaneously, Bramus put forth a prolific series of proposals. He introduced the class prefix selector (.something-*), offering a cleaner, faster alternative to verbose attribute selectors. He also proposed the @supports named-feature() function, allowing developers to query hyper-specific layout and transform behaviors that were previously impossible to feature-detect cleanly.


Supporting Data and Technical Implementations

To understand the practical impact of these updates, we must examine the underlying code and architectural patterns driving them.

1. The Class Prefix Selector vs. Attribute Selectors

Historically, targeting elements with shared class prefixes required clunky attribute selectors, which carry performance penalties and readability hurdles:

/* Legacy Attribute Selectors */
[class^="something-"] 
  /* Matches class="something-xxx" */


[class*=" something-"] 
  /* Matches class="xxx something-xxx" */


[class*="something-"] 
  /* Matches class="my-something-xxx" */

The proposed class prefix selector radically simplifies this syntax into a clean, intuitive format:

/* Proposed Class Prefix Selector */
.something-* 
  /* Clean, performant, and native matching */

2. Grid Information in Custom Properties

By mapping grid dimensions to CSS variables, developers can calculate spatial relationships dynamically in the stylesheet. While current implementations require columns of equal width, this technique bridges the gap between layout structure and visual styling, empowering designs that react organically to grid geometry.

3. Flexbox Balancing

Following the success of text-wrap: balance, the web platform is expanding balancing concepts into layout containers. Ahmad Shadeed’s analysis of flex-wrap: balance illustrates how browsers can automatically distribute items evenly across rows or columns, eliminating ragged, lopsided flex layouts without manual sizing hacks.

What’s !important #18: <geolocation>, Syntax ::highlight()ing, named-feature(), and More | CSS-Tricks

Official Responses and Community Debate

As is standard in the vibrant front-end community, these new proposals have sparked healthy debates among leading experts.

Dark Mode Toggles: Two-State vs. Tri-State

A prominent community debate erupted over how applications should handle dark mode toggles.

  • Lea Verou advocated for a streamlined two-state approach.
  • Bramus made a strong case for a tri-state configuration (Light, Dark, and System Auto).
  • Meanwhile, developers like Vale.Rocks championed a nuanced middle ground: an "auto-until-overridden two-state approach," which respects user system preferences by default while allowing manual overrides that persist gracefully.

Progressive Enhancement and the <geolocation> Element

Because the new <geolocation> element is currently restricted to Chrome environments, community leaders have focused heavily on bridging strategies. By wrapping the native element in graceful fallback patterns alongside the legacy JavaScript Geolocation API, developers can deploy these features today without alienating users on other rendering engines.


Implications for the Future of Web Development

The rapid convergence of these features signals a mature phase for CSS and HTML. We are moving away from an era where developers had to construct complex JavaScript state machines to handle UI interactions—such as tooltips, syntax highlighting, and grid tracking—and moving toward a declarative, browser-native paradigm.

  1. Reduced JavaScript Footprint: By shifting responsibilities like syntax highlighting (::highlight()), layout balancing (flex-wrap: balance), and intent detection (interest-delay-start) directly to the browser, client-side bundles will shrink, leading to faster load times and improved Core Web Vitals.
  2. Enhanced Developer Ergonomics: Proposals like the class prefix selector and named-feature() demonstrate that standards bodies are actively listening to developer pain points, aiming to eliminate boilerplate code and fragile workarounds.
  3. The Rise of Progressive Enhancement: As advanced features roll out incrementally across engines (notably Chrome leading the charge on interest invokers, geolocation elements, and advanced @supports queries), mastery of progressive enhancement remains a non-negotiable skill for modern web architects.

As we transition into the autumn season, the toolkit available to CSS developers is more powerful, expressive, and efficient than ever before. Keep experimenting, stay tuned to the latest specs, and continue building a faster, more resilient web.

Back To Top