relative image size with "em" units
|Reported by:||clemens||Owned by:||Ryan J Ollos|
I am missing the ability to specify the picture size in "em" units. I believe that a picture size relative to the font size would be an improvement.
In our environment we often insert pictures like flow diagrams, screen-shots and others figures with much text. Of course our Trac users use different screens, from small laptop screens up to ultra wide screens, some have low resolution some have 4K resolution. Our users also use different desktop and browser magnifications factors like 150%.
Of course we are aware that we can setup the height and width as arguments to the Image-macro:
The height and width can be absolute pixels or relative percentage:
[[Image(photo.jpg, height=200px)]] [[Image(photo.jpg, width=50%)]]
But neither pixels nor percentage can accommodate for all screen sizes and resolutions. Often pictures are too small or too big.
Trac could be improved and offer "em" units for images.
It could look like this (note the
[[Image(photo.jpg, height=20em)]] [[Image(photo.jpg, width=30em)]]
Since I received positive e-Mail feedback from Ryan, I decided to open this ticket. He wrote (in the mailing list on 2019-08-08):
Adding recognition of em units to
ImageMacrosounds good to me. That would be a good bitesized ticket for anyone looking to contribute to Trac.
Quotation from https://www.sitepoint.com/power-em-units-css/ :
The Power of em Units in CSS
In CSS, an em unit is equal to the computed font-size for the element to which the em is applied.
Note that "em" is not supported by the HTML
<img> tag, it needs CSS.