Okay
  Public Ticket #2138970
Problem with modules' less
Closed

Comments

  • Taras started the conversation

    Hello.

    We have your Claue theme on local Magneto 2.3.2 and we have a problem that with your theme activated standard Magento modules' styles are not included to the css files. I mean app/code/<vendor>/<module>/view/web/css/source/_module.less files which are autoincluded to compilation with Magento 2 themes normally (Blank, Luma and third-party themes which we used before).

    How to get _module.less files working as expected? This is a very serious problem for us.

  • [deleted] replied

    Dear Taras,

    Thanks for your ticket,

    I understand you mean but this is not theme bug, the theme doesn't extend from Luma or Blank theme so the style of Luma or BLank theme is not included in our theme

  • Federico Reggiani replied

    The problem also occur with Hebes.

    This is a bug from the themes, standard Magento modules doesn't work with your themes.

    How to include _module.less files on compilation?

  • Taras replied

    I have inspected the problem. It's hardly fixable. You can't only include _module.less files, you also have to include all magento's libs/mixins which the modules.less depend on. I believe you should always use theme which extends default magento's luma or blank theme

  • Federico Reggiani replied

    The problem is that the themes are not compatible with the standard way to add .less files to modules

    https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/css-preprocess.html


    So it's not compatible with Magento 2

  • Federico Reggiani replied

    A "kind of solution" is to paste the content of the _module.less file inside theme.less file, from the theme.

    In that way it compiles the CSS.

    It's a bit weird, but works.

  • [deleted] replied

    Hello Taras and Federico Reggiani ,

    Thanks for your comments,

    Yes as I said, the theme doesn't extend from Luma theme or Blank theme because we have Front-end Builder, and it is not easy to extend from Luma or Blank now because the lib/mixins library will be included and CSS will be conflicted. Also Federico Reggiani said, now if possible please paste the content of _module.less to theme.less