Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Tether elements to each other with CSS anchor positioning (chrome.com)
191 points by feross on March 1, 2023 | hide | past | favorite | 82 comments


CSS has several long-standing problems in a similar vein to this one, most famous being the “center a div” problem. A simple-to-specify end result (“I just want to center this content within its parent”) is desired, a series of arcane CSS magic invocations are devised and become accepted as the standard invocation to solve the problem (usually using translateX/Y -50%), and eventually a series of formal and more general solutions are implemented in the CSS spec that solve the problem in progressively fewer lines of CSS (first “display: flex; align-items: center; justify-content: center;”, now we are down to “place-self: center;”). It’s good to see that the problem of anchoring tooltips is progressing through this process!


> now we are down to “place-self: center;”

`place-self` still requires the parent to be a flex-box container, though. You can't just apply it to an arbitrary element to make it center in its parent.

`place-self` is just shorthand for setting both `align-self` and `justify-self` in a single proeprty - I don't see how this is necessarily an improvement: CSS is already (unfortunately, necessarily) confusing at it is, so adding a literally redundant CSS property with a distinct name is not going to reduce confusion nor make CSS any more accessible.

CSS's shorthand properties work best when the shorthand version actually aids comprehension, rather than making you think: for example, `border: <width> <style> <color>;` and `margin: <top> <right> <bottom> <left>;` are great examples of how they should be: either because each parameter is unambiguously typed (in `border`'s case: widths, border-style and colors are very distinct) or uniformly-typed but follow a familiar pattern (e.g. `margin:`'s parameters are all length-values but are in a clockwise sequence) - this is not something we see in some of the more modern shorthand properties like `flex` and `box-shadow` where you need to have pre-memorized which parameter corresponds to each longhand property, e.g. it's non-obvious that the `2` in `flex: 1 2 3px` is for `flex-grow` - or that the `3px` in `box-shadow: 1px 2px 3px 4px rgba(0,0,0,0.2);` is for `blur-radius` and not `spread-radius`.

> It’s good to see that the problem of anchoring tooltips is progressing through this process!

I'm also strongly in favour of this CSS feature, it's a long-time coming - BUUUUT I also really would have liked some browser-native tooltip/title feature that allows for rich-content without resorting to hacks like `foo[title]::after { position: absolute; content: attr(title); etc }`


Parent element "modes" that affect child layout and "enable/disable" child available properties is what makes CSS tricky. To do CSS well you end up having to learn all the modes and all the properties, which makes CSS a defensible professional specialization, but its less good for drive-by designers who just want simplicity. (My personal favorite remains the good old "absolute layout".)

(Aside: another technology in the thankfully small know everything before you can do anything set is gradle, a popular build tool in the Java universe. These tools are capable, but quite demanding of the user. Git may also qualify.)


Right.

Prior to CSS, it used to be that literally anyone could (and should!) write HTML: web-pages were just simple documents (by design) using only paragraph-flow content with inline objects (like images, Java applets, ActiveX on Windows), and appearance was directly set inline with <font>, <small>, etc. This is fine for web-page documents, but not web-page applications, and it turns out that defining a layout system for a medium as flexible as a web-browser viewport is very, very hard.

It's the same thing with desktop software: previously it was perfectly acceptable for a VB6 application to consist entirely of fixed-size windows with controls placed at fixed-positions, with no resize logic - or to handle re-flow when the text changes, or high-DPI for that matters. Users, today, have much higher expectations, and now it's now basically impossible for a "citizen programmer" to meet the expectations of normal users, and I feel this is a bad trend for everyone: we all love to grimmace at a giant Excel VBA macro doing 20 things at once that still somehow works, but the person or company that actually has that macro really is better-off than someone without it.

-------

The complex layout systems in modern UI frameworks (like WPF/XAML, Cocoa Touch, etc) are converging with CSS (or vice-versa, depending on your experience) in their expressiveness - which necessitates complete abstraction-away from fixed-layout WYSIWYG systems that were the key component of the democratization of desktop computers since the late-1980s, and while HTML was never WYSIWYG an average person could still immediately understand what `<font color="">` did - and could immediately see how their fixed-layout VBA Form would look when it runs.

Unfortunately I don't have a solution to this problem: citizen-programmers are going to need a WYSIWYG fixed-layout design tool, but such a tool is fundamentally incompatible with end-user expectations - and essential things like accessibility and device-portability. I guess we'll be stuck with proprietary, half-arsed, "low-code"/"no-code" tools for a long while.


Even longer ago, with fixed width fonts and fixed size screens things were even better. On C64 the keyboard had --- ||| characters to draw line with corner characters T splits and + . The empty space was filled with space characters so you could just move around your cursor. Someone with no previous experience could draw boxes and make cool looking menus. Could stick a few sprites on it with absolute positioning.

Supporting all kinds of screen sizes is a dumb idea but we are stuck with it. If you also want to support different languages the screen is mostly empty with logograms and the languageswithgiantwords stick out of the boxes. We are pretty lucky English is a reasonable middle ground.


> Supporting all kinds of screen sizes is a dumb idea

No, it isn't a dumb idea.

> If you also want to support different languages the screen is mostly empty with logograms and the languageswithgiantwords stick out of the boxes.

...what you're describing only happens if a page/screen/layout is designed without reflow in-mind. Otherwise it will look fine and natural. Every layout system that supports text reflow will support forced hyphenation for dealing with zeverylongcompoundwords in German and other languages.


If you make a painting it is suppose to be viewed at a specific size. If you specifically create it to work at different sizes (like a logo) you suffer enormous constraints. I took a picture one time of a boat on the horizon under a beautiful sky with a few distant seagulls that, while small, were absolutely necessary for the composition. It looked stunning full screen, one could almost smell the ocean. When slightly scaled down the clouds turned uninteresting, the boat lost all detail, the waves and the gulls just vanished.

One could certainly argue that there is no need for such things and that an interface can be (or should be?) equally usable on any kind of screen. To me it stops being art at that point. It reminds me of The Night watch, they "reflow" the painting by cutting parts of. People thought one can just do that. Or perhaps they showed it's not a problem, I dunno. It's not for me.


> You can't just apply it to an arbitrary element to make it center in its parent.

You can with grid-first.

With the proviso that third party components may not work (which is fine, third party components are usually very low quality). I'd recommend, right after your existing:

  *,
  *:before,
  *:after {
    box-sizing: border-box;
  }
Adding:

  div {
    display: grid;
  }
You can now remove:

- all margins (there's just padding and gap now)

- margin auto centering hacks

- clearfix hacks

- translateY -50% hacks

- a billion wrappers around every UI element (per all those low quality third party components, particularly common in the react space which seems to have a culture of "add divs until it looks right")

plus a bunch of other code.

In 99% of cases, using grid-first, there will be a 1:1 match of element to UI - getting around the div-soup of older web apps.

The app I'm developing now is 1:1 with the exception of rounded gradient borders, which still needs a hack.


> ...your existing

I don't use CSS Reset techniques: don't try to fight the browser.

> div { display: grid; }

I'm concerned this will have a nontrivial impact on browser layout performance. Existing browser layout engines are heavily optimized for flow/block layout, but defaulting every div to grid breaks that major assumption all the browser-makers made and... for what gain? I actually don't want every div to potentially be a grid layout container by default.

> You can now remove $things:

I don't use any of those tricks/hacks anyway - and clearfix hasn't been relevant since IE8 came out.

> rounded gradient borders

Just use border-radius combined with `border-image: some-gradient-function()`. No hacks or tricks required.


I've been doing grid-first for a few years now (last major update was when buttons hot grid support) across apps including high performance google docs-type collab interfaces. It's fine.

Optimising for existing behavior reminds me of when people didn't want to use async/await as V8 'wasn't optimised' for it. await never felt slow in their apps anyway, but now it's similar fast to what callbacks were. Skate to where the puck going to be.

> for what gain? I don't use any of those tricks/hacks anyway

OK. Everyone else does but maybe you're the exception.

> For rounded gradient borders... just use border-radius combined with `border-image: some-gradient-function()`. No hacks or tricks required.

Are you sure? https://stackoverflow.com/questions/51496204/border-gradient... - judging by the views on that question, if you have a codepen there's at least 42,000 people who'd love to see, it my understanding is that the W3C spec says it shouldn't work.

Probably obvious, you sound like you know what you're doing but: adding additional elements, pseudoelements etc counts as hacks.

Here's border-radius combined with `border-image: some-gradient-function()`:

https://codepen.io/mikemaccana/pen/QWVpdmo


Thank you for that info - I honestly didn't know that border-radius didn't work with border-image.


It’s OK! Thanks for replying politely. HN can be combative sometimes.


> I'm concerned this will have a nontrivial impact on browser layout performance.

I've experienced this with iOS Safari. I was experimenting with different layout methods, and at one point a display:grid didn't get deleted, and some days later when I was testing with Safari it was taking at least half a second to render a page. I'm talking 5 paragraphs of text, possibly with subgrid I was experimenting with, nothing crazy. I had no idea CSS could ever get that so slow and I thought it had to be something with React, and it took way longer than it should have to narrow it down to that single property.


> I'm concerned this will have a nontrivial impact on browser layout performance. Existing browser layout engines are heavily optimized for flow/block layout

Layout and paint performance is pretty low stakes. Unless you’re doing a lot of painting, or your demographic is surprising, your users are going to be fine.


>some-gradient-function()

>which still needs a hack


Fully agree with your take. CSS should have more straightforward properties that actually do what people intuitively expect it to do without additional dependencies and weird side effects.

Even the supposedly favorable case of having a flexbox container with place-self: center in many cases still does not correctly center the child element. For example, a label inside a button. The label is typography, which means it has its own vertical spacing (line-height, top-cap, bottom margin) that may be unevenly distributed. Fixable, but now you're into the 3rd rabbit hole, just to center something.


I completely agree with your take on what makes for a good shorthand property, I would also have pointed to border: as a good shorthand and flex: as a bad shorthand. I think place-self: is a good shorthand, though - the fact that it’s a redundant way to specify two separate properties in a single line is good in this specific case because it matches the developer’s mental model of “center this div please” being a single and simple request. Yes, the truth of layout is that centering stuff is not actually simple and does not involve one single operation, and so we have had to build complex layout systems to handle all the edge cases and complexities, but now that we’ve built those systems it makes sense to offer a shorthand for this common request that resolves to the set of commands required to achieve the result. (e.g. I think ES6’s for-of iteration construct is a good idea, despite redundancy/confusion with the existing C-style for-i++ iteration construct.)


Every few years I have to look up what the current state of the art is for centering something in CSS. I've so often been shocked that there still wasn't something as simple as <center>. Similarly, I couldn't believe how long it's taken to get something as useful as tables for layout.


I also used to be annoyed by how long it took to get “basic useful functionality” for some use case in CSS. Over the years I have mellowed as I recognized it simply takes a long time to converge on what functionality is actually desired, and then what systems need to be in place so you can request that functionality in the most obvious location in your code (e.g. it turns out we really want to put the request for centering on the element to be centered, not the parent) along with figuring out the truly minimal, truly necessary information to carry out that functionality — and then further still to implement those needed systems in all major browsers. It’s just a long and incremental process by its nature and we probably can’t do much better than that. Ironically, the fact that the state of the art changes every few years is evidence that this process, though slow, does work reliably well.


<center> just centered text horizontally. This have been supported by CSS from the beginning.

The CSS property display:table gives you the same layout power as tables.


<center> is effectively

    <div style=”text-align: center;”>
      <span>centered element</span>
    </div>


Not so easy, at least:

    <span style="display:inline-block">centered element</span>
But in general <center> still cannot be 100% expressed by CSS means.


Never heard of place-self before! I've always resorted to fumbling around with flexbox froggy and wondering why the changes I make to froggy seemingly don't do the same thing to my simple HTML.


Laughing in bed because I always assumed I was the only one using froggy as my flexbox reference material.

The worst is when you get angry and start blaming the frog for its lies. As if it's the frog's fault...


First I've heard of place-self as well. I see it's been available for quite some time. I've always used the "longhand" version instead of this shorthand property. Good to know.


If we would have flex units instead of display:flexbox then this:

   div {
     width:max-content; 
     margin:*;
   }   
is enough to place block in the middle of its container (vertically and horizontally), see: https://terrainformatica.com/2018/12/11/10-years-of-flexboxi...


Mt secret is to use <center> but I cant remember how many times I've considered using js and absolute positioning. The user clicks an image, the image is enlarged to fit the viewport, remaining space is filled with a color. Doable with css. The user zooms the image (scale), so far so good... the user pans the image... uhh how do I limit panning in css? bounding rectangle + get computered style??


Pan by adding a wrapping element with ‘overflow: hidden’ and use ‘translate’ to move the child image element inside it.


That sure saved me a lot of time making something ugly that shouldn't exist.

Thanks!


With display:flex on the parent you can just put margin:auto on the child. That's what I do and it works fine. Although I admit to having used the transform trick more than a few times before flexbox was a thing.


> most famous being the “center a div” problem

It's crazy how many attempts at this have been done over the years. And it worked great in Adobe Flex, back in 2009.


Whaaaaaat? I thought

> margin: 0 auto;

would be the way to go for centering divs...


https://jsfiddle.net/c7gt4or2/2/

No luck for elements of unspecified widths, or for inline elements.


Ah yes, but that's what container-divs are for, am I right?! ;-)


I don't suppose this (or another forthcoming CSS property) would allow multiple `position: sticky` elements to stack after each other (instead of underneath)?

That is one of our biggest layout PITAs, is the slippery slope of "sticky the table header" ... "and the filtering controls above it" ... "and the page header as well", and these are all across different levels of the DOM / component tree.

We currently solve it with React portals, which lets elements in the component tree "promote up" their localized content to the single/top-level-stickied div, so that within that div they can all flow after each other & not overlap.


> is the slippery slope of "sticky the table header" ... "and the filtering controls above it" ... "and the page header as well", and these are all across different levels of the DOM / component tree.

I've been using `thead > tr > * { position: sticky; }` just fine for years, with filtering controls within `<th>`. Don't forget to also specify `scroll-margin:` though, as that's how you get `position: sticky` to play-nice with other potentially-overlapping elements.


The spec implies that:

    header {
      position: sticky;
      anchor-name: --header;
      top: 0;
    }    

    .controls {
      position: sticky;
      anchor-scroll: --header;
      anchor-name: --controls;
      top: anchor(--header bottom);
    }

    th {
      position: sticky;
      anchor-scroll: --controls;
      top: anchor(--controls bottom);
    }

Should work, but 'stickiness' is not taken into account in the current build. Not sure why the anchor names are global instead of following the normal cascade. you could just have:

    .sticky {
      position: sticky;
      anchor-scroll: --sticky;
      top: anchor(--sticky bottom, 0);
      anchor-name: --sticky;
    }
And .sticky children would stick to the bottom of their .sticky ancestors. As it is it still seems like most practical use cases will wind up needing JS to find and then name the position-anchor.


This sounds interesting to me. One of the struggles with sticky table headers is supporting automatic column widths. How does your portal trick support that? Currently I'm using a double rendering trick combined with resize observers.


We only use `position: sticky` for the first row of the table, but then stack everything else in a separate div, so something like:

- parent div

-- 1st child div, everything that is "stickied" to the top of the screen (really a tree of react components like the header + filters + table actions)

-- 2nd child div, the table itself with a single position: sticky header row

The portal trick/approach is that technically the table is rendered by some leaf-ish component in the 1st child's component tree, but once the leaf components knows "hey I'm the leaf", it uses a portal to push it's content to the 2nd top-level child, which gets it stuck below everything in the 1st child.

It sounds kind of elaborate, but it lets everything in the top div get correctly dynamically sized without any hard-coded offset hacks.


I wonder if they should rename the concept to avoid confusion with the ubiquitous and existing anchor tag, <a>? :(

I think it's confusing to introduce an HTML attribute named "anchor" that has nothing to do with HTML anchors.


Well most people don't call it an anchor tag, they call it an a or link tag. I think the battle for clear naming is already lost. What would be a good alternative name for anchor positioning, though?


Tether?


If you liked this and you use Twitter, follow the author (@jh3yy) - one of my favorite CSS tweeters.

eg

"Use anchor positioning to tether an element to multiple anchors" https://twitter.com/jh3yy/status/1628127228763537409


This has been sorely needed for a long time. Z-index issues are a perennial nightmare on the frontend. And the React Portal style solution is less than ideal, as it introduces markup dependencies. Glad to see it finally handled by CSS.


Just CSS is not enough for tooltips...

Here is what we've got in 10+ tooltip providing experience in Sciter[1] ...

Declarative tooltips support:

    <div title="some text" /> 
    <div titleid="dom-element-id" /> 
    <div tooltip="<b>some html goes here</b>" /> 
Dynamic support, on demand, event handler:

    element.ontooltiprequest = function(evt) {
       evt.relatedTarget = ... some dome element reference ...   
    }
Dynamic, explicit popup show:

    anchorEl.popup(popupEl, {anchorPos:..., popupPos:...});
    anchorEl.popup(<div>some JSX expr</div>, {anchorPos:..., popupPos:...});
Popups (tooltips included) are shown as out-of-canvas elements - separate desktop windows, that's the must for desktop UI. Check this: https://terrainformatica.com/w3/sciter-tooltip.png

So far these APIs appear as complete, I do not have other tooltip related requests last 5 or so years.

And finally CSS styling:

    anchorselector > popup[role="tooltip"] {
      ...
    }
[1] https://sciter.com


How do you style the tooltips? Fixed positioning? I always run into issues where I need to maintain some document.body level collection of tooltips because 'position: fixed' is affected by its parent elements also having 'position: fixed' applied- it's deceptively not as simple as just inserting a tooltip in the DOM where the anchor lives.


There is a special internal position:popup mode that cannot be set in CSS. Only internally.

position:popup is accompanied with the pair of anchor-position:1..9 and popup-position:1..9 props. For the meaning of these numbers see NUMPAD keys on keyboard. They define attachment of popup to the anchor.

anchor-position:1; popup-position:7; means border-box bottom-left corner of anchor corresponds to top-left margin box corner of popup. That positioning schema defines position of the popup relative to the anchor.



I’m not sure how I feel on this one. The solution looks complicated, but really the problem itself is also complicated.

Maybe this is just as simple as it can get? Either way, avoiding a large amount of quite expensive JS is promising. Looking forward to seeing how this goes. Would love to rip out floating ui dependency.


Yeah I'm fairly proficient with CSS, having written it for over a decade, and as I skimmed the article I found myself getting a bit overwhelmed. Seems like quite a bit of effort.

For years I've been working on a programming language for UI designers, and this was one of the stumbling blocks for me. It's definitely a hard problem.

My solution was to enforce unique names for every element, and then you could use a simple syntax for describing positioning constraints between them. For example:

  BlueSquare {
    width: 100px
    height: 100px
    top: 0px
    left: 0px
  }

  RedSquare {
    width: 100px
    height: 100px
    top: @BlueSquare.bottom + 10px
    left: @BlueSquare.right + 10px
  }
This code would anchor the red square to the bottom/right of the blue square, with a 10px spacing between the two. Super simple! Far more difficult to implement a backend that satisfies this of course, which is why I haven't made much progress lol.


This is what Slint[1] does in their UI language[2].

1: https://slint-ui.com/

2: https://slint-ui.com/releases/0.3.5/docs/rust/slint/docs/lan...


Every time I bring up my language on HN, someone tells me about a project I've never heard of before. This is super interesting, thanks for sharing!


FWIW the equivalent code with this API is:

  .BlueSquare {
    width: 100px;
    height: 100px;
    top: 0px;
    left: 0px;
    anchor-name: --BlueSquare;
  }

  .RedSquare {
    width: 100px;
    height: 100px;
    top: calc(anchor(--BlueSquare bottom) + 10px);
    left: calc(anchor(--BlueSquare right) + 10px);
  }
https://jsfiddle.net/kbqua1te/


If I remember right, QML used in Qt allows that kind of positioning.


Yep, Qt uses a very similar syntax.


Fundamentally the anchoring problem requires you specify 1. the target you want to anchor to, and 2. where in relation to the target you want your content to appear (above, below, justified to a particular edge, etc…). “anchor: below ——my—target;” seems about as simple as you can get.


Sure, the happy path is straightforward. I'm fine with that (except I don't see why they're pursuing the HTML attribute variant... just keep it CSS).

The complexity comes later in the article when they talk about handling details and oddities. Like `position-fallback`.

Again, maybe this is just as simple as it gets since it's just a hard problem. I really would love a CSS-only solution to this. Use cases are everywhere, and I certainly don't have any better ideas.


Part of the "hmm" factor for me on this one is that these "anchor" and "anchor-size" functions really just seem like cute names for a more generic "get position of element" and "get size of element" functions. So it's a big departure from the way I always imagined CSS (a tree of styles where an element was affected mostly/completely only by its ancestors/siblings) vs this proposal cracking that model by letting styles interact between elements "horizontally" across different trees.

We already kind of did that with grid I guess. It feels like one step closer to imperative code in CSS rather than declarative, but I'll take it over JS to achieve this effect.


This is the same felling I get about it as well. Breaking that understood cascading never sits well in my brain.


At a certain point you've got to draw a line and say this isn't a case for CSS and HTML don't you? We should've developed/completed Houdini (allowing low-level access to layout from JavaScript) ages ago to save us from incorporating everything under the sun into CSS only to arrive at a single implementation able to render it.


This is a dangerous proposal, it includes adding a new HTML element attribute “anchor” that will completely reposition the element.

I would expect there are frameworks out there using “anchor” as a custom attribute that this would break.

Changing the CSS spec is all well and good, but I’d like a slower more considered approach to the HTML spec.


Shouldn't they be using `data-anchor` then? If you are using raw attributes then you risk breakages.


Isn't the introduction of new attributes perfectly normal in how HTML advances? If a framework breaks because of that, it's their own fault.


I use the position:absolute approach, but One issue I don't know how to solve is that part of the floating div might be outside its parent, and will stretch the size of its parent. Even the parent has display:relative; overflow: hidden.


I don't understand why we can't have something like this:

```

.target {

  name: myname
}

.tooltip: {

  left: var(myname.left),

  bottom: calc(var(myname.top)-20px)
}

```

What's hard about exposing some element properties in var()? Instead of just making specific APIs all the time.


With this API this would be:

  .target {
    anchor-name: --myname;
  }

  .tooltip {
    left: anchor(--myname left);
    bottom: calc(anchor(--myname top) - 20px);
  }
https://jsfiddle.net/3rasnhyp/


I made a drag-and-drop page builder once upon a time and tethering the tooltip to the draggable object was such a pain in the ass unless I made the tooltip a child of the draggable object which isn’t ideal.

Can’t wait to see CSS anchoring.


Is this being done by the Chrome team alone, or has this been submitted to a group like whatwg?

I think it is important for Chrome to keep on innovating, but the community should call them out for assuming a monopolistic position.


The spec is a W3C CSS working group draft: https://drafts.csswg.org/css-anchor-position-1/

It looks like less of a Chrome thing and more of an Edge thing? The Intent to Prototype [1] links to an Edge explainer [2] with Microsoft authors. It doesn't look like anyone has asked Mozilla for a position yet [3] but I expect if they get positive signals from web developers (us!) that will be soon.

[1] https://groups.google.com/a/chromium.org/g/blink-dev/c/vsPdd...

[2] https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/...

[3] https://github.com/mozilla/standards-positions/issues?q=anch...


There's a link to the CSSWG draft[0] in TFA (along with a warning that the current implementation isn't completely in sync with it).

[0]: https://drafts.csswg.org/css-anchor-position-1/


It's sort of like Storyboard layout constraints in MacOS app development?


I stopped reading when it said this was behind a browser flag. Was I wrong to stop reading; is there a better story than that?

I've been doing CSS long enough to know that to get things work you often have to work with what you have and that means wrapping things inside (otherwise) redundant containers, etc.

Using a polyfill is less than ideal, but at least I have control over including this. And, it says it is under development, so I didn't even want to use that.

But, asking my users to enable a browser flag? That's a non-starter.

I'll file this under something interesting to revisit in a year or two.


Uhm, this is a preview. You’re not supposed to use it until it’s widely available. They’re just showing it off and gathering feedback.

> I'll file this under something interesting to revisit in a year or two.

Correct. However things are moving fast so certain new features become widely available within months.


> available within months.

Unless you need to support iOS... In which case, wait a few years because we can't have the web platform being too effective compared to apps...


They've been very quick at implementing CSS changes in Safari, faster than Firefox in some cases, but yeah bigger web APIs like push notifications have taken too long


Perhaps because CSS is entirely a programming task within the rendering engine...

But Web Push requires changes from the whole browser, perhaps minor changes to the OS, and probably a whole server side implementation.

And with all that cross-team effort going on, it's very easy for management to deprioritize it.


That seems like a good guess. I'd also guess that there are a lot more internal politics involved when they're implementing OS-integrated features that are easy to abuse. There are a lot of sites that ask for notification permission that definitely don't need to, and that probably saps some of the motivation for implementation at Apple. It's frustrating for developers with completely valid use cases, frustrating for open web standards, but I can understand being overprotective of user experience. It's a difficult balance.


> I'll file this under something interesting to revisit in a year or two.

That's fine to do if you're only interested in "is this a thing I can use now" (no, not yet). But if you care about how the feature is designed and are worried that they might get it wrong, now is the time to read the proposal and speak up!


Generally stopping reading over a small complaint is, yeah, pretty petty.


You're completely right. It's a kludge for attaching elements in a page structure that wasn't designed for it, and of course it's Chrome only.


I mostly do web development. Is there a UI framework that really nails this pop over and alignment problem that you have in mind?





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: