contao / core

Contao 3 → see contao/contao for Contao 4
GNU Lesser General Public License v3.0
492 stars 213 forks source link

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

Open rburch opened 11 years ago

rburch commented 11 years ago

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.

leofeyer commented 11 years ago

?

rburch commented 11 years ago

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.

leofeyer commented 11 years ago

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

rburch commented 11 years ago

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.

skipman commented 10 years ago

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:

andreasisaak commented 10 years ago

@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.

leofeyer commented 6 years ago

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

rburch commented 6 years ago

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.

skipman commented 6 years ago

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.

Aybee commented 6 years ago

👎 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.