2

While working on a custom theme with blank parent theme , I noticed strange behaviors: First of all, gulp and grunt give a different output. Mostly these are parts of code in different order (on gulp's output, the parts are below to grunt's output). Also, comparing only these code parts, there are differences. (see here) With the help of sourcemaps it would seem that the code comes from

"pub / static / frontend / vendor / theme / en_US / css / source / _extends.less"

This comes from the default blank theme. Normally, Magento uses "_extend.less" files for less instructions extending existing styles. But why use "_extends.less"? I noticed it existed only in this position and only on the blank theme.

The styles-l.less load this file like this:

  @import (reference) 'source / _extends.less';

Is there a particular reason for its use?

UPDATE

Removing extends.less from blank theme, gulp's output and grunt's output are the same.

A possible workaround could be to remove the extends.less file and then have the same result with both.

However, there is still a doubt as to why this file was inserted (and why in this way).

  • 1
    I think _extends.less is only a less partial with a confusing name that is not related to the _extend.less mechanism – Lorenzo Aug 11 '17 at 11:30
2

From a further study, the extends.less file would appear to be an additional file used only as a "container" of abstract classes. So all abstract classes used or newer should be write in this file.

The problem apparently originates from a wrong compiler's interpretation (I think the nesting between more ":extend").

I opened a new question for solve-problems-with-different-magento2-less-compilation-outputs

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.