-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix conflict for logo_height argument by default.xml #30370
base: 2.4-develop
Are you sure you want to change the base?
Conversation
Hi @PierW. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
@magento create issue |
@PierW Can you update for blank theme ? |
@mrtuvn Done, thanks :) |
Ok seem everything ok with me |
@magento run all tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Broken functional tests seem not related to this PR.
Hi @ptylek, thank you for the review.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @PierW.
Looks like the changes don't solve the issue.
Manual testing scenario:
-
Magento 2.4-develop
-
Create a new theme child of Luma
-
Create the default.xml and copy this:
<referenceBlock name="logo"> <arguments> <argument name="logo_file" xsi:type="string">images/logo.png</argument> <argument name="logo_height" xsi:type="number">300</argument> </arguments> </referenceBlock>
-
Put your custom logo.png inside the images folder.
-
Save and delete the cache
-
Refresh the page
Actual Result: ✖️ The logo image is still with the same parameters
@PierW Maybe we missed something?
Could you take a look?
Thanks!
Pull Request state was updated. Re-review required.
images/logo.png 300 @engcom-Alfa Could you try to do that in developer mode? So we will check better why and where do you have the image{ height: auto} in style-m.less, I'm sure, now I tried again. With Luma and Blank theme do you have just: |
@engcom-Alfa fixed! It was the line 50 (Height: auto) of _resets.less file on version 2.4 of magento. |
@@ -49,7 +49,6 @@ | |||
|
|||
img { | |||
max-width: 100%; | |||
height: auto; | |||
border: 0; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove height here may cause image distorted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So why is there methods 'logo_height' inside the block if we can't use that?
If you don't put that in _resets.less... and you don't set an height, it will be "auto" for default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm ok with height auto in file reset. Only need remove redundant code in folder theme when you already have set default in reset file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use both define width height attribute image html and also use height auto in css. Note you also able to set width height of logo in config from backend
#29721 |
Description (*)
For a new theme, for example child of luma, if you want change the logo by default.xml and set also his size by the height, you should write this:
<referenceBlock name="logo"> <arguments> <argument name="logo_file" xsi:type="string">images/logo.png</argument> <argument name="logo_height" xsi:type="number">300</argument> </arguments> </referenceBlock>
Now the problem is that it doesn't works, because there is a conflict with the line 151 of _module.less:


The result is that our rule is overwritten:

It doesn't happen with Width.
Sometime we want set the image by height and not by the width... or maybe with both... why not? It's your choice.
So for now the logo_height have no sense to exist.
The height: auto should be deleted and all will work fine.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Magento 2.4-develop
Create a new theme child of Luma
Create the default.xml and copy this:
Put your custom logo.png inside the images folder.
Save and delete the cache
Refresh the page
Questions or comments
Contribution checklist (*)
Resolved issues: