News for hackers. Stuff that matters.
Re:Aspect-ratio is great by eyelidlessness on Thursday February 10, 2022 @02:13AM (#30283263)
> Why would you have different default behaviours if you have one of the dimensions set but not the other?

Basically: be there or be square (fill up the space or not, your choice), but if you show up there’s a dress code (you can only fill up the space as specified).

> Oh look, lets define a new property and call it aspect ratio, and then lets ensure it doesn't maintain an element's aspect ratio if you have content that is going to overflow if you specify a width. This is what drives me mad about css, it's gotchas all the way down.

There’s a lot I don’t like about CSS, but this is just the spec avoiding undefined behavior. No one is using aspect ratio for unbounded text in practice, they’re using it for media or a design system. Knowing how it behaves for edge cases is much better than having a protracted battle for years while vendors sort it out, with different assumptions in the wild.

Re:Aspect-ratio is great by eyelidlessness on Thursday February 10, 2022 @02:41AM (#30283396)
To emphasize this point, the alternatives would be ridiculed:

- overflow is assumed by default and constraining it is a whole bunch of necessary compromises, so my element maintains an aspect ratio but its content is overlapping siblings with the same aspect ratio. What the hell were they thinking?

- my element with 16:9 aspect ratio and the full text content of Moby Dick serialized as JSON was so wide my browser ate all my memory and swap, locked my computer up forcing a hard reboot

Re:Aspect-ratio is great by torgard on Thursday February 10, 2022 @04:07AM (#30283914)
> full text content of Moby Dick serialized as JSON

Reminds me of when YouTube added a new comment system, but didn't specify a max length, and rendered the full text by default. People were spamming the Bible in comments.

Re:Aspect-ratio is great by r_hoods_ghost on Thursday February 10, 2022 @02:41AM (#30283398)
You could instead just define the edge case behaviour so it is sane and consistent, e.g Text always overflows unless otherwise specified, or text is always clipped, rather than "lets stop the thing doing what it says it's doing". I swear the CSS spec considers "insane by default" To be a feature.
Re:Aspect-ratio is great by frosted-flakes on Thursday February 10, 2022 @07:46AM (#30285297)
What you propose is insane by default. Clipped or overflowing text is almost never what you want.
Re:Aspect-ratio is great by layer8 on Thursday February 10, 2022 @04:58AM (#30284260)
The problem is that CSS is not (and continues not to be) designed to minimize such conflicting specifications, and does not provide a unified, explicit and systematic way to control conflict resolution.
Re:Aspect-ratio is great by jontro on Thursday February 10, 2022 @02:34AM (#30283363)
If you set overflow: hidden it seems to do the trick on chrome at least
Re:Aspect-ratio is great by eyelidlessness on Thursday February 10, 2022 @11:55AM (#30288992)
Right. As one would expect.