After that, it should take about 2.5 years for the feature to become Baseline widely available, and depending on your audience[0], you might be able to use it even sooner.
https://bugzilla.mozilla.org/show_bug.cgi?id=css-anchor-posi...
Really unfortunate because it lets Google get away with anything they want, they are the new standard. But then again, I'm reminded of how Mozilla has pissed away all the users goodwill, and it's not a surprise.
Doesn't this count? Been there for several years.
I don't know the best solution for the problem, but CSS is a very convoluted one.
[0] - https://spectrum.adobe.com/page/tooltip/
[1] - https://shoelace.style/components/tooltip
[2] - https://ui.shadcn.com/docs/components/tooltip
[3] - https://popper.js.org/docs/v2/modifiers/arrow/
[4] - https://primer.style/product/components/popover/guidelines/
https://react-spectrum.adobe.com/react-aria/Tooltip.html#exa...
One killer feature of CSS anchor positioning is that it allows you to declaratively define fallback positions if the floating element does not fit into the preferred position. For example, you prefer your tooltips to appear below the anchor; but if the anchor happens to be at the bottom of the screen, there is no space below it, and so the floating element can flip to the top.
After the flip, the triangular svg will be pointing in the wrong direction.
...do you mean you want a rich-HTML tooltip that is auto-positioned to ensure it's fully visible w.r.t. the browser's viewport but you also want the tooltip (or UI in general) to include an arrow shape that stays fixed on-target even if might be occluded by the browser?
An arrowhead pointing at the anchor element.
Example: https://en.wikipedia.org/wiki/Tooltip#/media/File:Mobile_URL...
UPD: In spec speak, these are called tethers. The anchoring indicators
https://fantasai.inkedblade.net/style/specs/css-anchor-explo...
I was reading the article and thinking it would be a great thing to adopt for some code we recently wrote, but we have to support Firefox. And since we already have an existing solution that works, no point cleaning it up with this until Firefox adopts it.
Still, looks like a very nice feature.
It’s not especially uncommon. For instance payment requests, web share, and remote playback are all implemented by Blink and WebKit but not Gecko.
https://developer.mozilla.org/en-US/docs/Web/API/Payment_Req...
https://developer.mozilla.org/en-US/docs/Web/API/Web_Share_A...
https://developer.mozilla.org/en-US/docs/Web/API/RemotePlayb...
I occasionally look into what CSS is being transcoded for the projects I work on, and it’s normally Firefox ESR that needs the most help. If you eliminate that from your browserlists configuration, your source and deployed CSS become a lot more closely aligned. For instance, it was only a year ago that Firefox ESR got CSS nesting.
IIRC Firefox lagged quite a lot on Color Profiles and :has
Background data sync/download with continuation
For example it helps when the anchoring element is inside of an oveflow hidden/scroll container, but geometrically you need the tethered element to sit/extend outside of the container (so—for now at least—its DOM node needs to be outside of the container).
The simplest example is if you have content that it not contained by the box you're positioning against. Think tooltips, popovers, etc.
For some usecases like annotating content, this hugely simplifies things.
Very true, they started 2 years ago and it has been constantly worked on with the latest update 12 days ago: https://bugzilla.mozilla.org/show_bug.cgi?id=1838746
So, it literally will be "any day now" :-/
The `margin:0` issue was particularly frustrating & imo should have been covered in the article, as it's a real gotcha when trying to use popover & anchor positioning in combination.
My first attempt was to anchor an element to another one that occurred later in the document order, and it didn’t work. The anchor must be placed before any of its dependents. It kind of makes sense, but doesn’t jump out as intuitive.