HomePhabricator

Make the image at most as high as the viewport

Tags
None
Referenced Files
None
Subscribers
None

Description

Make the image at most as high as the viewport

Add an additional restriction on the max size of the image: it should
not only be no wider than the page (minus padding), but also no higher
(no padding to be considered on this axis). The scale still applies.

Because calc() can only divide by numbers, i.e. we can’t divide the
var(--width) / var(--height) and have the px cancel each other out, we
need another variable with the numeric ratio. (Could also be two
separate variables, but then the naming of the variables with vs.
without px would become more confusing.) Use this opportunity to also
add another comment listing the available variables more explicitly.

Closes #1.

Details

Provenance
LucasWerkmeisterAuthored on May 15 2022, 3:01 PM
Parents
R2422:a70ceb49c907: Add JS version of scale input
Branches
Unknown
Tags
Unknown
ChangeId
None