magento / magento2-page-builder

Magento2 PageBuilder
Other
79 stars 59 forks source link

Fixes less/css compilation when using less.js v4 #860

Closed hostep closed 8 months ago

hostep commented 9 months ago

Description (*)

This complements https://github.com/magento/magento2/pull/38335

In your internal tickets AC-8098 & AC-9713 less.js got upgraded from v3 to v4 However, that switch is not fully backwards compatible, the math stuff now needs to be encapsulated in parentheses for less.js to do the calculation and not output it as-is to the generated css.

This module only has one mistake as far as I could find, this is the output of compiling the less code like it is right now with v4 compared to v3 and this results in invalid css:

--- pub/static/adminhtml/Magento/backend/en_US/css/styles.css 2024-01-08 17:44:24
+++ pub/static/adminhtml/Magento/backend/en_US/css/styles.css  2024-01-08 17:44:34
@@ -13248,7 +13248,7 @@
 }
 [data-content-type='products'] .product-reviews-summary,
 .pagebuilder-products .product-reviews-summary {
-  margin-bottom: 1.5rem;
+  margin-bottom: 1rem + 0.5rem;
 }
 [data-content-type='products'] .product-reviews-summary .reviews-actions,
 .pagebuilder-products .product-reviews-summary .reviews-actions {

This PR fixes it and will output margin-bottom: 1.5rem; again.

Manual testing scenarios (*)

See testing scenario in https://github.com/magento/magento2/pull/38335

Checklist

hostep commented 9 months ago

@magento run all tests

magento-automated-testing[bot] commented 9 months ago

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

magento-automated-testing[bot] commented 8 months ago

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

hostep commented 8 months ago

Is no longer needed, this was only needed when the strictMath option was enabled in the less.js compilation. But we'll keep it disabled. See https://github.com/magento/magento2/pull/38335#issuecomment-1883771156

Closing, sorry for the noise!

magento-automated-testing[bot] commented 8 months ago

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

magento-automated-testing[bot] commented 8 months ago

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.