core icon indicating copy to clipboard operation
core copied to clipboard

Choice between px, %, or em when sizing an image in the Image Element.

Open rburch opened this issue 12 years ago • 10 comments

Maybe the best practice is to use css but I sometimes wish I could resize an image in an image element element with % rather than the default. Especially with .svg images. Maybe this is something to consider with the next Contao release.

rburch avatar Nov 27 '12 14:11 rburch

?

leofeyer avatar Nov 27 '12 19:11 leofeyer

Reading back what I wrote before sorry I didn't explain it well.

In an image element or content element, where you can enter an image size, it would be handy if I could choose em or percent with a drop down. So that if I wanted I could make the image 50% wide.

rburch avatar Nov 27 '12 20:11 rburch

I see. So 50% width means half the original size, right? Or 50% relative to the containing element?

leofeyer avatar Nov 30 '12 15:11 leofeyer

I was thinking 50% of the original size. I hate to make the comparison, but that's how Wordpress does it. I would use it most for making images for high resolution displays like ipads and the new Macbook Pros but I'm sure there are other uses as well.

rburch avatar Nov 30 '12 15:11 rburch

Sorry, wenn ich da mal in deutsch dazwischenquatsche, aber ich fände es überhaupt toll, wenn sich Contao generell von der absoluten "Verpixelung" lösen würde und durchgängig relative Schriftgrößen bzw. Abstände einführen würde oder zumindest relative Einheiten auswählbar macht. Bei den Bildabständen funktioniert das ja sehr fein, aber bei den (Text-)Element-Abständen (Abstand davor und dahinter) schon wieder nicht mehr :-1:

skipman avatar Apr 23 '14 15:04 skipman

@Skipman

Relative Einheiten bei den Abständen beziehen sich aber immer auf die Breite eines Containers und nicht dessen Höhe. Daher tendiere ich das Feld "Abstand davor und dahinter" endlich ganz zu streichen. Relative Maßeinheiten machen das Feld nicht sinnvoller.

andreasisaak avatar Apr 23 '14 16:04 andreasisaak

Is this ticket still relevant now that we have image sizes in Contao?

leofeyer avatar Mar 20 '18 14:03 leofeyer

It could be, though usage would be different than the original thought above. I don't always want to use a set size. Sometimes I just want an image to be 80% of the container, and don't want to add a css class to do it for just one image. It would be handy I think, but I haven't run into the issue as much as I used to when building sites.

rburch avatar Mar 20 '18 14:03 rburch

Im with rburch, a selector for px/% would be usefull. In best case theres an additional switch "relative to: picture size / containing element. That will meet all needs editors may have.

skipman avatar Mar 20 '18 15:03 skipman

👎 As this would result in inline style.

Generating the thumbs must always use px.

Setting a picture to generate a thumb to 50% of its original makes no sense to me.

Aybee avatar Mar 21 '18 14:03 Aybee