Live data from Hacker News

On The (2021)

benmyers.dev

71–80 of 138 posts

Re: On The <dl> (2021)

#71
post #62

This is going to be unpopular here, but life became easier when I quit trying to write semantic HTML. It’s just poorly designed, I’m sorry. Every time I’ve reached for a I’ve eventually regretted it because I wanted multiple levels of wrappers, or a divider between sections, or an icon, or a heading spanning multiple key-value pairs, etc. They make this stuff with some flexibility but nowhere near enough to actually…

As a person who daily drives a screen reader, I so agree with this.

We'd all be better off if the W3 dispensed with all that ideological semantic purity BS and started doing more realpolitik. Think not about whether your API is semantically pure, but about what developers want to do, what hacks they'll use to achieve their goals despite your objections, and how to enable doing those things in a way that is maximally beneficial to everyone involved.

ARIA live regions are the perfect example. What developers actually want is `document.speakText`. What developers actually have is a weird API that announces text on the page as it changes. They have to bridge from one to the other, which is difficult and hacky, even when implemented well. But hey, at least that live region approach is semantically pure HTML...

Re: On The <dl> (2021)

#72

> This is incorrect: 1. has no corresponding ( viz. implicit) role, but can be given the role group, list, none or presentation https://w3c.github.io/html-aria/#el-dl >. 2. You’re only allowed to define aria-label on elements that have a compatible role, implicit or explicit https://w3c.github.io/html-aria/#docconformance-naming >. 3. aria-label is allowed on all but a handful of roles https://www.w3.org/TR/wai-aria-…

Your comment put me on a side quest to research the differences between i.e., e.g., viz. and sc. and I have to admit that I’m still not 100% sure

Re: On The <dl> (2021)

#73
post #64
post #62

This is going to be unpopular here, but life became easier when I quit trying to write semantic HTML. It’s just poorly designed, I’m sorry. Every time I’ve reached for a I’ve eventually regretted it because I wanted multiple levels of wrappers, or a divider between sections, or an icon, or a heading spanning multiple key-value pairs, etc. They make this stuff with some flexibility but nowhere near enough to actually…

Sounds like it's CSS' fault then. I think that just like they introduced `display:contents` to remove wrappers, they should also introduce a way to group elements as if they had a common ancestor. :wrap(dt, dt+dd) {border: solid 1px}

Proposal from 2016 (closed): https://github.com/w3c/csswg-drafts/issues/588

Re: On The <dl> (2021)

#74
post #64
post #62

This is going to be unpopular here, but life became easier when I quit trying to write semantic HTML. It’s just poorly designed, I’m sorry. Every time I’ve reached for a I’ve eventually regretted it because I wanted multiple levels of wrappers, or a divider between sections, or an icon, or a heading spanning multiple key-value pairs, etc. They make this stuff with some flexibility but nowhere near enough to actually…

Sounds like it's CSS' fault then. I think that just like they introduced `display:contents` to remove wrappers, they should also introduce a way to group elements as if they had a common ancestor. :wrap(dt, dt+dd) {border: solid 1px}

Good idea. Together with ::after / ::before and content: (which can insert text into the website) it might then be possible to create a website without any HTML, only CSS.

Re: On The <dl> (2021)

#75
post #59

Earlier quoted context omitted.

Shameless plug: you might be interested in https://calvinlc.com/p/2026/02/11/everything-is-a-div.html I need to learn more about web accessibility, but if you completely ignore it (and other sane practices) HTML looks really simple. I think the design of HTML is just too much. There’s so many tags that don’t do much. It’s like w3c decided that any common thing people use in websites needs a tag. The end result is mor…

Oh that’s great. It’s an opinionated view that focused strictly on the behavior of the tags wrt layout and appearance. I’ve noticed that discussions of semantic meaning of tags often contain the word “feel.” Nothing wrong with that, taste matters, but it does point to the non-functional goals that are being pursued when people disagree. vs - they are both ordered, because markup is ordered. One gets decorated differe…

A is a list of things whose order makes no difference to its meaning. Rearranging a would change the presentation, not the information. Rearranging an would change both.

   Players
     Alice
     Bob
     Carol
  

   Leaderboard
     Bob
     Alice
     Carol
  

Re: On The <dl> (2021)

#76

> Prior to HTML5, this was called a definition list. This is because the was originally only intended to represent glossaries of terms and their definitions. TIL I’ve been naming it wrong for a decade.

Bleh. is apparently now bring attention to. As if.

Re: On The <dl> (2021)

#77
post #64
post #62

This is going to be unpopular here, but life became easier when I quit trying to write semantic HTML. It’s just poorly designed, I’m sorry. Every time I’ve reached for a I’ve eventually regretted it because I wanted multiple levels of wrappers, or a divider between sections, or an icon, or a heading spanning multiple key-value pairs, etc. They make this stuff with some flexibility but nowhere near enough to actually…

Sounds like it's CSS' fault then. I think that just like they introduced `display:contents` to remove wrappers, they should also introduce a way to group elements as if they had a common ancestor. :wrap(dt, dt+dd) {border: solid 1px}

With CSS Grid math you can fake it, at least. If your DL is `display: grid;` and if you have a few extra DIVs lying around at the bottom of the DL to be borders around combined cells you just have to math which rows/columns you want to draw a border around and make the div fit that combined shape.

Re: On The <dl> (2021)

#79
post #23

> Admittedly, however, support for the element is not yet universal. Wait what? has been in HTML since.. the first draft in 1993! I like DL's but they can be challenging to style. This article is using a lot of fixed pixel widths which would break on really small screens or larger data.

I've found CSS Grid is extremely useful for styling DLs.

Re: On The <dl> (2021)

#80
post #62

This is going to be unpopular here, but life became easier when I quit trying to write semantic HTML. It’s just poorly designed, I’m sorry. Every time I’ve reached for a I’ve eventually regretted it because I wanted multiple levels of wrappers, or a divider between sections, or an icon, or a heading spanning multiple key-value pairs, etc. They make this stuff with some flexibility but nowhere near enough to actually…

As a person who daily drives a screen reader, I so agree with this. We'd all be better off if the W3 dispensed with all that ideological semantic purity BS and started doing more realpolitik. Think not about whether your API is semantically pure, but about what developers want to do, what hacks they'll use to achieve their goals despite your objections, and how to enable doing those things in a way that is maximally…

I don't want that. I don't want to care about screen readers (unfortunately I have to). I want a system where I can pick well-defined rules and then css can style it, screen readers will understand it, automations can parse it, keyboard navigation is free.

Obviously thats not what we got, but I feel like the set of established UI patterns is manageable enough that it could be built.

A great example is the new styling that developers styled in all kinds of creative ways. Now give me that for comboboxes, trees, data-grids etc...

Post reply on HN