User tests: Successful: Unsuccessful:
After updating to 4.2.7, I noticed my custom login images were going outside of the bounds of the box, due to Joomla writing the width in line. I applied a max-width to that image as a possible fix.
Images larger than the login box go outside of the bounding box.
Images larger than the bounding box on login fit within the box.
Category | ⇒ | Repository NPM Change |
Status | New | ⇒ | Pending |
Title |
|
I have tested this item
The height: auto is absolutely necessary, otherwise the height=xyz from the IMG tag will be used and is then distorted.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39766.
I'm a bit confused. Are you requesting me change the height to auto? I never said anything about height, and my commit was only setting max width.
The height: auto is absolutely necessary, otherwise the height=xyz from the IMG tag will be used and is then distorted.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39766.I'm a bit confused. Are you requesting me change the height to auto? I never said anything about height, and my commit was only setting max width.
The PR for max-width ist successful, but if you take an high-edgewise image then it will be warped.
That would be the case if we were setting width, but in this case we are setting max width to ensure images that are too wide for the login box don't go outside the login box. The height style that is set is already in core.
max-width solves the problem for images that are too wide for the login module. If your logo is portrait or square and maybe not so wide then the max-width has no effect, but the max-height and the image looks distorted. Normally it should be max-width:100% in combination with height:auto or width: auto and max-height: 4.4rem to allow the image to resize correctly.
Labels |
Added:
NPM Resource Changed
?
|
I think, in the case of the logo for the login module, the height of the image is more important than the width. Imagine if someone puts a 800px high image, the login will looks very weird and you will need to scroll to be able to enter your credentials.
IMHO is max-height: 4.4rem and width: auto the better solution... but that should be tested with different kind of logos.
Agreed
Not sure if object-fit would help here somehow.
Not sure if object-fit would help here somehow.
I was thinking about that too, but in this case you want to display the full logo, object-fit will crop the image...
Took a high picture on purpose. Loaded: 525 x 700 px. :-) But there is no new npm package yet for testing.
Would above example OK for patch, @drmenzelit?
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-02-03 20:41:38 |
Closed_By | ⇒ | fancyFranci |
Thank you for fixing that!
Fix works, but can I suggest a slightly different approach? 4.4em is tiny for a lot of logos.
What about something like:
max-height: 15rem;
max-width: 100%;
object-fit: contain;
This bounds the logo by whichever dimension is larger and makes sure it doesn't get distorted, and also makes sure it's not way too tall or too short.
Sorry, I didn't catch this before it was merged!
The height: auto is absolutely necessary, otherwise the height=xyz from the IMG tag will be used and is then distorted.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39766.