Saturday, September 19, 2026
HomeProgrammingWhat’s !vital #18: , Syntax ::spotlight()ing, named-feature(), and Extra

What’s !vital #18: , Syntax ::spotlight()ing, named-feature(), and Extra


Nicely, that’s a wrap. No, not a flex-wrap, however somewhat at the moment marks a brand new day, week, month, season, aaaand re-creation of What’s !vital (#18), bringing you the perfect content material that CSS builders have produced over the past couple of weeks or so.

Abhishek Jakhar defined why tooltips must be delayed then on the spot (principally, in order that we don’t set off them by accident, after which after we don’t need them anymore, in order that they disappear instantly). Abhishek confirmed us tips on how to implement all of that, too. One factor that I’d prefer to level out is that if the hover-able area is simply too small, the tooltip may be de-triggered unintentionally, so I’d preserve the delay in that case.

Chris Coyier then responded to that with a contemporary implementation that makes use of curiosity invokers, which include two key CSS properties: interest-delay-start and interest-delay-end. Solely Chrome helps curiosity invokers in the intervening time, however progressive enhancement, proper?

<geolocation> and tips on how to use it at the moment

Talking of progressive enhancement, the Geolocation API has at all times been difficult due to the entire exterior {hardware} concerned (GPS satellites, Wi-Fi networks, mobile towers, and so on.) and the way irritating it may be to vary the permission standing later. <geolocation> fixes numerous that however introduces a number of new quirks. For instance, there are some…styling restrictions.

Two location permission Chrome dialogs offering options to manage location access settings.
Supply: Piccalilli.

And since solely Chrome helps it, I defined tips on how to use <geolocation> alongside the present Geolocation API, which implies that you should use it at the moment, primarily.

MicroLighter: a ::spotlight()-based syntax highlighter

Dave Rupert made a small syntax highlighter referred to as MicroLighter utilizing the brand new Customized Spotlight API. He additionally confirmed us tips on how to use MicroLighter, and Geoff talked a bit about it too.

A web page for MicroLighter, displaying feature highlights and installation instructions.

Methods to get CSS grid info into CSS variables

Temani Afif demonstrated tips on how to get CSS grid info into CSS customized properties. Particularly, tips on how to get the variety of rows and columns, in addition to the coordinates (x/y indexes) of every cell. The one situation is that the columns will need to have equal widths, however with the way in which that CSS has been evolving these days, that would undoubtedly change.

Temani additionally confirmed us how we will use this to find out hover proximity, which is very cool:

Darkish mode: two-state or tri-state?

Lea Verou says two-state, however Bramus says tri-state — what do you say? Personally, I just like the auto-until-overridden two-state strategy, as described by Vale.Rocks:

An introduction to the category prefix selector

Bramus additionally launched the category prefix selector, which, despite the fact that it isn’t supported anyplace but, could be very easy and really helpful (as you may see under), so I’m anticipating a fast turnaround on this one.

.something-* {
  /* ... */
}

That is cleaner and extra performant than attribute selectors:

[class^="something-"] {
  /* Matches class="something-xxx" */
}

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

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

Right here’s what Geoff needed to say concerning the class prefix selector.

…and the named-feature() operate

Bramus (who’s type of on a roll right here, to be trustworthy), additionally launched the @helps named-feature() operate. This one’s supported by Chrome although, and principally queries assist for very particular issues that will in any other case be unattainable to question, resembling whether or not the browser respects transforms when anchor positioning components, however hopefully it makes @helps extra succesful all-round.

Methods to stability wrapped flex objects throughout rows or columns

What’s additionally new to Chrome is flex-wrap: stability, which is principally text-wrap: stability however for flex objects. Ahmad Shadeed defined what flex-wrap: stability does and what we will use it for.

New net platform options and updates

Autumn/fall, right here we come!

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments