Hacker News new | ask | show | jobs
by halapro 28 days ago
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}
3 comments

Seems the original ::contents proposal is where it's at now, though there hasn't been action on it for some time. Not sure if they hit a snag or it's just on the back burner

https://github.com/w3c/csswg-drafts/issues/2406

This proposal has the benefit of not violating the tree structure should multiple :wrap rules apply to overlapping elements.

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.
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.