Re: [csswg-drafts] [flex] Sizing images with intrisic aspect-ratio: ¿harmonize with grids?

@fantasai Ok let's rephrase slightly then.

I am currently evaluating the following idea: elements with ```width:auto;height:auto``` and an aspect ratio would behave like if they had ```width:auto;height: var(width * aspect-ratio)``` instead when alignment is ```normal``` (and maybe also ```stretch```). 

That way we could say that all elements (irrespective of aspect-ratio) behave as ```stretch``` in both directions, but the height only stretches if it is considered auto which would not be the case for an element that has an intrinsic aspect ratio. The fact width gets computed first is not a novelty, this is true in all browsers and all layout modes (by width I mean inline size ofc). 

Then either ```stretch``` would be an agressive ```normal``` that ignores aspect-ratio or maybe we don't even need any different with ```normal``` at all since you can get the stretch behavior using position:absolute +top/left/right/bottom:0 inside your grid area. It is even better because using stretch/normal will cause you to influence the track sizing with your image intrinsic size which is rarely what you want, especially if you want to stretch. 



-- 
GitHub Notification of comment by FremyCompany
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1112#issuecomment-288944391 using your GitHub account

Received on Friday, 24 March 2017 06:32:16 UTC