-
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
Different results from compiling less with Grunt or with "server side compilation" #7231
Comments
If you are able to install and use nodejs on your production server, you can use our module, which uses less.js to compile less files on the server instead of the less.php library (which indeed produces slightly different results). |
thank you @hostep, i'll try your module |
@hostep your module works well |
@slackerzz Thanks for reporting that. Internal issue MAGETWO-60689 |
any news here? |
This is expectable by itself since client-side and server-side preprocessing use different library versions. Providing a reproducible narrowed use case (some visual bug) would simplify investigation. |
@slackerzz, thank you for your report. |
Am I living in a bubble or is nobody else other than those already partaking in this issue experiencing this? I have what seems to be a reproducable case, and am happy to pass on some details if anybody is open to working on this. |
Hi @joshdavenport, of course providing a simple test case will simplify the investigation to whoever will work on this. Note that
Magento is not doing LESS compilation by itself, in case of bug most likely we will have to patch |
Before proceeding here, I've actually discovered that the different results for me between LESS complied via grunt and "server side compilation" was eliminated by downgrading grunt-contrib-less from 1.4.1 (which is using less 2.7.1) to 0.12.0 (which is using less 1.7.2). I think @hostep may have discovered this (based on the comments in their module referenced earlier). grunt-contrib-less is specified as 1.4.1 in the provided package.json.sample so it's fair to assume others using the grunt workflow have a real possibility of stumbling into this issue. Is it worth me reporting this separately? |
@joshdavenport : please do so. This happend when upgrading from Magento 2.1 to 2.2, the nodejs dependencies got updated and now less 2.x is getting installed even though the PHP library to compile less is only compatible with less 1.x I've reported this through some other channel a long time ago, can't remember when or how, but I failed at reporting it here on github. So please, go ahead and open a new issue. |
✅ Confirmed by @engcom-Charlie Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
Is this fixed? I think dev compilation should be the same result as what is produced in production mode no matter which tool. We shouldn't be saying things like "it works on my machine". Work on dev with grunt, deploy to production and just see same result... |
@engcom-November: I'm sure you executed your testing incorrectly. I do still see differences, but the situation has improved a lot since the issue got reported, mostly due to the Anyway, proper steps to reproduce:
The diff in --- /tmp/magento-static-grunt/frontend/Magento/luma/en_US/css/styles-l.css 2024-10-23 22:40:09
+++ pub/static/frontend/Magento/luma/en_US/css/styles-l.css 2024-10-23 22:41:09
@@ -2112,7 +2112,7 @@
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 14px;
height: 32px;
- line-height: 1.428571429;
+ line-height: 1.42857143;
padding: 0 9px;
vertical-align: baseline;
width: 100%;
\ No newline at end of file
@@ -3175,4 +3175,3 @@
margin-left: 85px;
}
}
-/*# sourceMappingURL=styles-l.css.map */
\ No newline at end of file The one in |
Preconditions (*)
Steps to reproduce (*)
While developing a custom template i found some differences between my local dev site (inside a vagrant box) and our staging server. Some css rules in the staging server are not applied, while in my dev box they work as expected. In my local environment i use grunt while in our staging server we use server side compilation.
The produced css files are different, the order in which css rules are processed is different!
So today i made some tests with a clean M2 installations and Luma theme.
*on the left side of the diff you have the server side compiled css
Expected result (*)
No diff
Actual result (*)
As you can see
styles-m.css
is ok, there are no breaking differences between the two versions.Sadly the two versions of
styles-l.css
are not equivalent, the order of the css rules in the two files is different and this can produce a different result.The text was updated successfully, but these errors were encountered: