Email or username:

Password:

Forgot your password?
Zach Leatherman :11ty:

#1 superfan of the CSS Anchor Positioning API: developer.chrome.com/blog/anch

Used it to implement more accessible heading anchor links on `eleventy-base-blog` using sibling elements without a wrapper element 🏆

You can see it in action here: eleventy-base-blog-git-v9-11ty (Chrome and Edge support this, falls back to a nested link in other browsers)

16 comments
Chris

@zachleat @DavidDarnes @ambrwlsn Lovely! As someone who has used Amber's version with the wrapping, the thought of being able to avoid that is excellent.

ambrwlsn

@zachleat @DavidDarnes well then I may have to update my site 😉🎉

Rijk 🐰 ✨

@zachleat Apparently it's so new it makes the DevTools crash 😳 (In Arc, which is Chromium based)

Zach Leatherman :11ty:

@rijk yeah! crashes every time I inspect in Chrome Dev Tools too 😬

cc @paul_irish

Ricky de Laveaga

@zachleat @rijk @paul_irish also only *works* in Chrome correct? Is Safari or Firefox support even on the horizon? Does @eleventy care about non-Chromium browsers?

Ricky de Laveaga

@zachleat @rijk @paul_irish @eleventy seems like a wrapper element that works in all browsers is vastly preferable.

Zach Leatherman :11ty:

@rdela @rijk @paul_irish @eleventy I suppose it’s my fault for not communicating the amount of nuance in play here. Make sure you test in Firefox/Safari to see the fallback behavior!

Ricky de Laveaga

@zachleat @rijk @paul_irish @eleventy I did test, see other response. Also I tried to have a conversation about this here mastodon.social/@rdela/1129740

…on GH github.com/rdela/eleventeen/pu

…and emailed you about it as well, Zach, to no avail. I get that the wrapper element isn’t your preferred choice here, but when even devtools is crashing, it became almost comical to me, so I thought I would chime in here as well.

Zach Leatherman :11ty:

@rdela @rijk @paul_irish @eleventy Not sure why this feels like a heated discussion—I am back from vacation and haven’t quite caught up on all my emails yet?

Unfortunately I don’t think the container element *is* preferable—it has markup and styling complexities that I’m trying to avoid (if possible!).

Rijk 🐰 ✨

@rdela only works in Chrome *at the moment* as they're the first ones to ship it. It's a w3 spec just like any other so it'll come to other browser soon enough. The way @zachleat implemented it means it's a progressive enhancement for browser that have it already, but it won't break or lock things down for other browser that don’t. 🙂

Zach Leatherman :11ty:

@rijk @rdela just to be super clear, the links are still positioned visually the same in other browsers, it’s just with less ideal markup

Ricky de Laveaga

@zachleat @rijk The links only show on hover now, a huge downgrade for both accessibility and discoverability. Also iOS Safari seems severely broken and doesn’t even show the links when you tap on the heading, not that I understand why one would, since there is no indication they are tappable.

Rijk 🐰 ✨

@rdela @zachleat While valid concerns overall, those aren't a result of using anchor positioning which kicked this thread off. You can see the same behavior in the previous iteration that didn't use the newly released CSS property eleventy-base-blog.netlify.app

nimstodon

@zachleat you might wanna warn people it's using corporate ipsum! I done got fooled

Go Up