-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Fixes less compilation problems in the Magento/luma theme #24003
Fixes less compilation problems in the Magento/luma theme #24003
Conversation
… in the lib code while it was being defined in the Magento/backend theme. (cherry picked from commit 9340950)
…xing: - Magento_CatalogSearch module: hides legend in advanced search form - Magento_Sales module: adds print icon to print link for sales objects in order history - Magento_AdvancedCheckout module: not sure, can't test at the moment
Hi @hostep. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Hi @ihor-sviziev, thank you for the review.
|
For now added "not covered" label, I think it could be automatically checked with original lessc compiler |
Failed B2B functional test
@engcom-Foxtrot please, take a look |
@magento run all tests |
Hi @engcom-Foxtrot @sidolov, |
|
Magento\QuickOrder\Test\TestCase\QuickAddToCartTest.test with data set "QuickAddToCartVariation1_0" is falling constantly on this PR. @hostep Please fix it. |
@slavvka: that failure is in the functional tests B2B, right? I don't have access to Magento B2B I think so I don't know how to test/fix this. |
@hostep oh, you are right. |
I'll take care of failing tests |
@magento run all tests |
@slavvka done ✔️ |
Hi @slavvka, thank you for the review. |
Hi @hostep, thank you for your contribution! |
Related Pull Requests
https://github.com/magento/partners-magento2b2b/pull/52
Description (*)
Hi
This PR is fixing less compilation problems in Magento's Luma theme as being reported in #23619
A PR for fixing similar problems in the Blank theme exists over here.
These less compilation problems can be found when using the original less.js compiler. Using version 2 or 3 of this compiler will output these problems.
These problems aren't being shown when using the php port of this compiler which Magento uses by default.
But the fact that these compilation errors are being reported means that certain less code in Magento isn't quite right.
And by digging in further, I was able to fix some problems which even improve the rendering on the frontend for features which were supposed to work, but didn't work due to these (hidden) errors. (this is mostly relevant in the PR for the Luma theme)
This PR consists of 3 commits.
Commit 1
The first commit is not directly related to the Luma theme, but caused a compilation problem with the Luma theme nonetheless:
.abs-modal-overlay
is being defined in the backend theme, but used in thelib
code, so that's incorrect. Moved the usage to the backend theme. The resulting css files don't change by doing this.Commit 2
The second commit is simply cleanup of code causing most of the compilation problems:
.abs-no-display-desktop
was being used in a different media query then where it was defined, resulting in the compiler not being able to find it. By moving it in the correct media query, we fix the compilation problem..abs-action-reset
is being defined in the backend theme, but was being used on the frontend, so this never worked, removed its usage on the frontend in this case, was recently introduced by MAGETWO-64838.clearer
is nowhere defined. It stems from the early days of Magento. It got first changed to '.mixin-clearer', and then later to '.lib-clearer', removed the usage of.clearer
here since it doesn't seem to be necessary anymore.abs-clearfix
is being defined in the backend theme, but was being used in a frontend theme, so this never worked, removed its usage on the frontend in this case.After this second commit, the resulting CSS is almost unchanged, except for a single change which cuts down the filesize of the resulting css file a tiny bit while do keeping the css code the same in behavior.
This is the diff of the css files after the second commit:
Commit 3
The third commit should in theory improve the rendering of a certain modules both in Magento Open Source as in Magento Commerce.
Unfortunately I don't have a copy over here at the moment of Magento Commerce to test it all out.
So if somebody could test this out in the Magento_AdvancedCheckout module on the frontend to see how and what this fixes exactly, that would be great!
.lib-clearfix
to that.block-addbysku .block-content
selector in this module@abs-blocks-2columns
to that.block-addbysku .block-content .box
selector in this moduleAfter this fix it should actually apply these mixins, before this fix these probably weren't being applied.
The other fixes are (see screenshots below in the Manual testing scenarios):
.abs-forms-general-desktop
being used in the wrong media query, it didn't work out).abs-forms-general-desktop
being used in the wrong media query, it didn't work out)The diff in the generated css file after the third commit is a little bit more involved:
Fixed Issues (if relevant)
Manual testing scenarios (*)
npm install less@3.9.0
rm -R var/view_preprocessed/* pub/static/*
bin/magento dev:source-theme:deploy --theme=Magento/luma --locale=en_US
styles-m.less
file using the less.js compiler:node_modules/.bin/lessc -l var/view_preprocessed/pub/static/frontend/Magento/luma/en_US/css/styles-m.less
Also do a full
rm -R var/view_preprocessed/* pub/static/*; bin/magento setup:static-content:deploy -f --theme=Magento/blank --theme=Magento/luma --theme=Magento/backend en_US
and compare the changes between the resulting css files without and with these fixes, only changed css files should be in the Luma theme, no other theme's css files should have changedThen look if these changes didn't cause regressions on the frontend when the Luma theme is being used
You can check in the frontend if the selector
.opc-estimated-wrapper
is still being hidden when the screens width >= 768px after this change on the checkout page:Somebody with access to Magento Commerce, should look at what happens to the following selectors and see if these are now being rendered properly (before the fix there should be something wrong with the layout I'm assuming):
.column .block-addbysku .block-content .box
.column .block-addbysku .block-content .box:nth-child(odd)
.column .block-addbysku .block-content .box:nth-child(even)
.column .block-addbysku .block-content:before
.column .block-addbysku .block-content:after
On the advanced search form, you should now no longer see the legend 'Search Settings' being rendered when the width of your screen is >= 768px
Questions or comments
I'm wondering if the 'Search Settings' legend in de advanced search form should also be hidden on screens with width < 768px
I feel like it is only there for accessibility reasons and should always be visibly hidden, can that be?
It would be nice if Magento could get some automated test which uses the less.js compiler linting mode to detect these problems.
Since one of these compilation problems was recently introduced in the Luma theme code, it probably can't hurt to do some automated testing to prevent this from happening again in the future.
See Manual testing scenario above for the commands needed to detect this.
Contribution checklist (*)