Dev Tools AI first try: a mix of nonsense and okay advice.
-
@mahryekuh No, in fact we shouldn't ever use the offset method. See: https://www.tpgi.com/the-anatomy-of-visually-hidden/#position @matuzo
-
@mahryekuh
Since I am not sure the LLM can guide a reader to HTML5 patterns over HTML4 by using the specs alone, they kind of have to look at popular patterns on crappy dev sites. -
-
@siblingpastry @matuzo Thank you! I use almost the snippet you shared, but with slight differences (like, I still need to remove `position` and `clip`), so that's a ToDo.
I also converted the snippet to logical properties instead of width and height.
-
@mahryekuh Which logical properties are you using for that? @matuzo
-
@siblingpastry @mahryekuh @matuzo I think `inline-size` (width) and `block-size` (height)?
-
@Anneke @mahryekuh Oh I see. Yeah that would work, but it's unnecessary -- since width and height are both defined the same, it doesn't actually matter which way round their axes flow. @matuzo
-
Marijke Luttekesreplied to James Edwards last edited by [email protected]
@siblingpastry @matuzo block-size and inline-size instead of width and height, respectively.
I deleted `clip` from my snippet (per your article), and now it's like this:
.visually-hidden:not(:focus, :active) {
block-size: 1px;
clip-path: inset(50%);
inline-size: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
} -
@siblingpastry @Anneke @matuzo I run stylelint with the `stylelint-use-logical-spec` in my personal projects, hence the width and height get converted by default.
-
Sarah Fossheim :100_gay:replied to Manuel Matuzović last edited by
@matuzo love that it suggests to slap an aria-label on there as well 🥲
-
@matuzo Back in the day I remember someone solving this by making part of the text the link (the heading for example) then using JS to expand the clickable area over the whole lot. No idea if that's still an advisable technique or not though.
-
@tink There are at least two JS solutions that work pretty well but with JS right and middle click don't work. There's no perfect solution if you ask me.