Difference between _module.less and _extend.lesssource/lib not available in magento 2 frontend designCSS and JS is not loading in new theme@media-common - Why do we need to use this?& when (@media-common = true) - Changes not picked up unless I do static-content-deployMagento 2 CSS Media Queries not working onBest way to extend module less found in web/css/source/module, like _minicart.less?Difference between _extend.less . and _extends.lessUsing media queries inError: Exception #0 (InvalidArgumentException): Unable to serialize value - Produced by custom Theme

Huffman Code in C++

How to preserve a rare version of a book?

Do Jedi mind tricks work on Ewoks?

Debian 9 server no sshd in auth.log

GitLab account hacked and repo wiped

Summer '19 Sandbox error: String index out of range: 0: Source

What is more safe for browsing the web: PC or smartphone?

How did the Force make Luke hard to hit in the Battle of Yavin?

What does the phrase "go for the pin" mean here?

How is trade in services conducted under the WTO in the absence of the Doha conclusion?

Ab major 9th chord in Bach

How important are good looking people in a novel/story?

What does the coin flipping before dying mean?

Changing stroke width vertically but not horizontally in Inkscape

Efficient deletion of specific list entries

My large rocket is still flipping over

Emergency stop in plain TeX, pdfTeX, XeTeX and LuaTeX?

How can I finally understand the confusing modal verb "мочь"?

Make me a minimum magic sum

Installing Debian 10, upgrade to stable later?

Justification of physical currency in an interstellar civilization?

Picking a theme as a discovery writer

Is there a reason why Turkey took the Balkan territories of the Ottoman Empire, instead of Greece or another of the Balkan states?

The selling of the sheep



Difference between _module.less and _extend.less


source/lib not available in magento 2 frontend designCSS and JS is not loading in new theme@media-common - Why do we need to use this?& when (@media-common = true) - Changes not picked up unless I do static-content-deployMagento 2 CSS Media Queries not working onBest way to extend module less found in web/css/source/module, like _minicart.less?Difference between _extend.less . and _extends.lessUsing media queries inError: Exception #0 (InvalidArgumentException): Unable to serialize value - Produced by custom Theme






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








17















Is there any difference between extending a theme using _module.less and _extend.less? And what is the best practice when extending a module/theme?



My first thought was it's better to use _module.less when styling a new module, and _extend.less when extending a module. But Luma uses _module.less when extending the blank theme so that theory has gone out the window.



The only difference I can see between them is _module.less is imported before the responsive library and _theme.less where as _extend.less is imported after them.



This is the order they are imported in vendor/magento/theme-frontend-blank/web/css/styles-l.less



//
// Blank theme desktop styles
// _____________________________________________

// These desktop styles are additional to mobile

//
// Global lib + theme styles
// ---------------------------------------------

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

//
// Magento Import instructions
// ---------------------------------------------

//@magento_import 'source/_module.less'; // Theme modules
//@magento_import 'source/_widgets.less'; // Theme widgets

//
// Media queries collector
// ---------------------------------------------

@import 'source/lib/_responsive.less';

@media-target: 'desktop'; // Sets target device for this file
@media-common: false; // Sets not to output common styles

//
// Global variables override
// ---------------------------------------------

@import 'source/_theme.less';

//
// Extend for minor customisation
// ---------------------------------------------

//@magento_import 'source/_extend.less';









share|improve this question




























    17















    Is there any difference between extending a theme using _module.less and _extend.less? And what is the best practice when extending a module/theme?



    My first thought was it's better to use _module.less when styling a new module, and _extend.less when extending a module. But Luma uses _module.less when extending the blank theme so that theory has gone out the window.



    The only difference I can see between them is _module.less is imported before the responsive library and _theme.less where as _extend.less is imported after them.



    This is the order they are imported in vendor/magento/theme-frontend-blank/web/css/styles-l.less



    //
    // Blank theme desktop styles
    // _____________________________________________

    // These desktop styles are additional to mobile

    //
    // Global lib + theme styles
    // ---------------------------------------------

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

    //
    // Magento Import instructions
    // ---------------------------------------------

    //@magento_import 'source/_module.less'; // Theme modules
    //@magento_import 'source/_widgets.less'; // Theme widgets

    //
    // Media queries collector
    // ---------------------------------------------

    @import 'source/lib/_responsive.less';

    @media-target: 'desktop'; // Sets target device for this file
    @media-common: false; // Sets not to output common styles

    //
    // Global variables override
    // ---------------------------------------------

    @import 'source/_theme.less';

    //
    // Extend for minor customisation
    // ---------------------------------------------

    //@magento_import 'source/_extend.less';









    share|improve this question
























      17












      17








      17


      2






      Is there any difference between extending a theme using _module.less and _extend.less? And what is the best practice when extending a module/theme?



      My first thought was it's better to use _module.less when styling a new module, and _extend.less when extending a module. But Luma uses _module.less when extending the blank theme so that theory has gone out the window.



      The only difference I can see between them is _module.less is imported before the responsive library and _theme.less where as _extend.less is imported after them.



      This is the order they are imported in vendor/magento/theme-frontend-blank/web/css/styles-l.less



      //
      // Blank theme desktop styles
      // _____________________________________________

      // These desktop styles are additional to mobile

      //
      // Global lib + theme styles
      // ---------------------------------------------

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

      //
      // Magento Import instructions
      // ---------------------------------------------

      //@magento_import 'source/_module.less'; // Theme modules
      //@magento_import 'source/_widgets.less'; // Theme widgets

      //
      // Media queries collector
      // ---------------------------------------------

      @import 'source/lib/_responsive.less';

      @media-target: 'desktop'; // Sets target device for this file
      @media-common: false; // Sets not to output common styles

      //
      // Global variables override
      // ---------------------------------------------

      @import 'source/_theme.less';

      //
      // Extend for minor customisation
      // ---------------------------------------------

      //@magento_import 'source/_extend.less';









      share|improve this question














      Is there any difference between extending a theme using _module.less and _extend.less? And what is the best practice when extending a module/theme?



      My first thought was it's better to use _module.less when styling a new module, and _extend.less when extending a module. But Luma uses _module.less when extending the blank theme so that theory has gone out the window.



      The only difference I can see between them is _module.less is imported before the responsive library and _theme.less where as _extend.less is imported after them.



      This is the order they are imported in vendor/magento/theme-frontend-blank/web/css/styles-l.less



      //
      // Blank theme desktop styles
      // _____________________________________________

      // These desktop styles are additional to mobile

      //
      // Global lib + theme styles
      // ---------------------------------------------

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

      //
      // Magento Import instructions
      // ---------------------------------------------

      //@magento_import 'source/_module.less'; // Theme modules
      //@magento_import 'source/_widgets.less'; // Theme widgets

      //
      // Media queries collector
      // ---------------------------------------------

      @import 'source/lib/_responsive.less';

      @media-target: 'desktop'; // Sets target device for this file
      @media-common: false; // Sets not to output common styles

      //
      // Global variables override
      // ---------------------------------------------

      @import 'source/_theme.less';

      //
      // Extend for minor customisation
      // ---------------------------------------------

      //@magento_import 'source/_extend.less';






      magento2 frontend view less-css less






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 20 '16 at 9:48









      Ben CrookBen Crook

      9,3692577




      9,3692577




















          3 Answers
          3






          active

          oldest

          votes


















          17














          The answer is somewhat hidden in the Magento docs:




          Extending a theme using _extend.less is the simplest option when you are happy with everything the parent theme has, but want to add more styles.




          Read more here



          Use _module.less when you want to make major changes in styles for a module and use _extend.less for minor adjustments. You'll find more examples on how to override component styles in the link above.






          share|improve this answer




















          • 1





            I've read that but it doesn't really explain why, it sounds like there's no reasoning behind it. I'm trying to figure out if there's any difference. I've been using _extend.less for all my changes as I prefer consistency to using something because 'Magento said so'.

            – Ben Crook
            May 23 '16 at 6:41






          • 1





            @BenCrook if my reading these past few days serves me right, no. If someone were to add any .less file in their theme with the same path as a file in the parent theme/module, that is an override. You could probably verify by creating a blank _module.less into your theme, and seeing if the original styles apply.

            – Darren Felton
            Dec 14 '16 at 14:20






          • 1





            After a php bin/magento setup:static-content:deploy, you can look into pub/static/frontend/<vendor>/<themeName>/<locale>/css/ and pub/static/frontend/<vendor>/<themeName>/<locale>/<Module_Name>/css/ and there will be symbolic links for *.less files to either your theme, or the module/parent theme it is coming from.

            – Darren Felton
            Dec 14 '16 at 14:23






          • 1





            That is correct _module.less overrides the parent less file, there is no inheritance or merging. I realise I could have made that more clear in my original answer :)

            – c.norin
            Dec 15 '16 at 12:24






          • 1





            @MattCosentino I realise this reply comes very late, but I'll leave this here in case someone stumbles upon it: Please note the difference between _extends.less and _extend.less. The _extend.less files can be added to any module context, to extend styles from a parent theme. The _extends.less is located in the root of the theme and is used to extend existing utilities (refer to <project>/lib/web/css/docs/source/_utilities.less).

            – c.norin
            Jan 15 '18 at 17:01


















          1














          The _extends.less with an S at the end within the Blank Theme, is a file where they created all the classes that can be extended via LESS later within the theme, without the need of creating new components or modular structure for style changes. -> For those who don't believe me: https://github.com/magento/magento2/blob/2.3-develop/app/design/frontend/Magento/blank/web/css/source/_extends.less check the file.



          The _extend.less without the S at the end, is for when you are 99% happy with what the parent theme has and you just need to change a couple of things, change some styling and that's it.



          About the latter one, my personal opinion, don't use it for your own developing. It creates a big mess later. Keep your structure modular with _module.less for every module you want to customize and you will get a better outcome & maintainable project at the end.






          share|improve this answer
































            1














            Simple explanation or difference between both:



            _extend.less is the way to extend/modify parent themes styles for example you're happy with your parent theme Luma and just want to change the button styles in your custom theme, all you need to do is create a new file _buttons_extend.less under web/css/source in your custom theme and adjust styles in there. Register this file by adding it to the _extend.less file inside your theme directory.



            What if you want to extend styles of a module e.g. checkout module, well you can create an _extend.less file inside your themes module folder e.g. Magento_Checkout/web/css/source/_extend.less and add/extend module styling in there.



            Now if I added _module.less file inside my module directory Magento_Checkout/web/css/source/_module.less I'm intending to override my parent themes styling for this module in which case I need to copy '_module.less' file from my parent theme's module directory and make modification to that file in which case this file will replace parent themes _module.less file altogether.






            share|improve this answer























              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "479"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f116248%2fdifference-between-module-less-and-extend-less%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              17














              The answer is somewhat hidden in the Magento docs:




              Extending a theme using _extend.less is the simplest option when you are happy with everything the parent theme has, but want to add more styles.




              Read more here



              Use _module.less when you want to make major changes in styles for a module and use _extend.less for minor adjustments. You'll find more examples on how to override component styles in the link above.






              share|improve this answer




















              • 1





                I've read that but it doesn't really explain why, it sounds like there's no reasoning behind it. I'm trying to figure out if there's any difference. I've been using _extend.less for all my changes as I prefer consistency to using something because 'Magento said so'.

                – Ben Crook
                May 23 '16 at 6:41






              • 1





                @BenCrook if my reading these past few days serves me right, no. If someone were to add any .less file in their theme with the same path as a file in the parent theme/module, that is an override. You could probably verify by creating a blank _module.less into your theme, and seeing if the original styles apply.

                – Darren Felton
                Dec 14 '16 at 14:20






              • 1





                After a php bin/magento setup:static-content:deploy, you can look into pub/static/frontend/<vendor>/<themeName>/<locale>/css/ and pub/static/frontend/<vendor>/<themeName>/<locale>/<Module_Name>/css/ and there will be symbolic links for *.less files to either your theme, or the module/parent theme it is coming from.

                – Darren Felton
                Dec 14 '16 at 14:23






              • 1





                That is correct _module.less overrides the parent less file, there is no inheritance or merging. I realise I could have made that more clear in my original answer :)

                – c.norin
                Dec 15 '16 at 12:24






              • 1





                @MattCosentino I realise this reply comes very late, but I'll leave this here in case someone stumbles upon it: Please note the difference between _extends.less and _extend.less. The _extend.less files can be added to any module context, to extend styles from a parent theme. The _extends.less is located in the root of the theme and is used to extend existing utilities (refer to <project>/lib/web/css/docs/source/_utilities.less).

                – c.norin
                Jan 15 '18 at 17:01















              17














              The answer is somewhat hidden in the Magento docs:




              Extending a theme using _extend.less is the simplest option when you are happy with everything the parent theme has, but want to add more styles.




              Read more here



              Use _module.less when you want to make major changes in styles for a module and use _extend.less for minor adjustments. You'll find more examples on how to override component styles in the link above.






              share|improve this answer




















              • 1





                I've read that but it doesn't really explain why, it sounds like there's no reasoning behind it. I'm trying to figure out if there's any difference. I've been using _extend.less for all my changes as I prefer consistency to using something because 'Magento said so'.

                – Ben Crook
                May 23 '16 at 6:41






              • 1





                @BenCrook if my reading these past few days serves me right, no. If someone were to add any .less file in their theme with the same path as a file in the parent theme/module, that is an override. You could probably verify by creating a blank _module.less into your theme, and seeing if the original styles apply.

                – Darren Felton
                Dec 14 '16 at 14:20






              • 1





                After a php bin/magento setup:static-content:deploy, you can look into pub/static/frontend/<vendor>/<themeName>/<locale>/css/ and pub/static/frontend/<vendor>/<themeName>/<locale>/<Module_Name>/css/ and there will be symbolic links for *.less files to either your theme, or the module/parent theme it is coming from.

                – Darren Felton
                Dec 14 '16 at 14:23






              • 1





                That is correct _module.less overrides the parent less file, there is no inheritance or merging. I realise I could have made that more clear in my original answer :)

                – c.norin
                Dec 15 '16 at 12:24






              • 1





                @MattCosentino I realise this reply comes very late, but I'll leave this here in case someone stumbles upon it: Please note the difference between _extends.less and _extend.less. The _extend.less files can be added to any module context, to extend styles from a parent theme. The _extends.less is located in the root of the theme and is used to extend existing utilities (refer to <project>/lib/web/css/docs/source/_utilities.less).

                – c.norin
                Jan 15 '18 at 17:01













              17












              17








              17







              The answer is somewhat hidden in the Magento docs:




              Extending a theme using _extend.less is the simplest option when you are happy with everything the parent theme has, but want to add more styles.




              Read more here



              Use _module.less when you want to make major changes in styles for a module and use _extend.less for minor adjustments. You'll find more examples on how to override component styles in the link above.






              share|improve this answer















              The answer is somewhat hidden in the Magento docs:




              Extending a theme using _extend.less is the simplest option when you are happy with everything the parent theme has, but want to add more styles.




              Read more here



              Use _module.less when you want to make major changes in styles for a module and use _extend.less for minor adjustments. You'll find more examples on how to override component styles in the link above.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Jan 10 '18 at 21:21









              Rafael Corrêa Gomes

              4,77523366




              4,77523366










              answered May 22 '16 at 13:54









              c.norinc.norin

              32727




              32727







              • 1





                I've read that but it doesn't really explain why, it sounds like there's no reasoning behind it. I'm trying to figure out if there's any difference. I've been using _extend.less for all my changes as I prefer consistency to using something because 'Magento said so'.

                – Ben Crook
                May 23 '16 at 6:41






              • 1





                @BenCrook if my reading these past few days serves me right, no. If someone were to add any .less file in their theme with the same path as a file in the parent theme/module, that is an override. You could probably verify by creating a blank _module.less into your theme, and seeing if the original styles apply.

                – Darren Felton
                Dec 14 '16 at 14:20






              • 1





                After a php bin/magento setup:static-content:deploy, you can look into pub/static/frontend/<vendor>/<themeName>/<locale>/css/ and pub/static/frontend/<vendor>/<themeName>/<locale>/<Module_Name>/css/ and there will be symbolic links for *.less files to either your theme, or the module/parent theme it is coming from.

                – Darren Felton
                Dec 14 '16 at 14:23






              • 1





                That is correct _module.less overrides the parent less file, there is no inheritance or merging. I realise I could have made that more clear in my original answer :)

                – c.norin
                Dec 15 '16 at 12:24






              • 1





                @MattCosentino I realise this reply comes very late, but I'll leave this here in case someone stumbles upon it: Please note the difference between _extends.less and _extend.less. The _extend.less files can be added to any module context, to extend styles from a parent theme. The _extends.less is located in the root of the theme and is used to extend existing utilities (refer to <project>/lib/web/css/docs/source/_utilities.less).

                – c.norin
                Jan 15 '18 at 17:01












              • 1





                I've read that but it doesn't really explain why, it sounds like there's no reasoning behind it. I'm trying to figure out if there's any difference. I've been using _extend.less for all my changes as I prefer consistency to using something because 'Magento said so'.

                – Ben Crook
                May 23 '16 at 6:41






              • 1





                @BenCrook if my reading these past few days serves me right, no. If someone were to add any .less file in their theme with the same path as a file in the parent theme/module, that is an override. You could probably verify by creating a blank _module.less into your theme, and seeing if the original styles apply.

                – Darren Felton
                Dec 14 '16 at 14:20






              • 1





                After a php bin/magento setup:static-content:deploy, you can look into pub/static/frontend/<vendor>/<themeName>/<locale>/css/ and pub/static/frontend/<vendor>/<themeName>/<locale>/<Module_Name>/css/ and there will be symbolic links for *.less files to either your theme, or the module/parent theme it is coming from.

                – Darren Felton
                Dec 14 '16 at 14:23






              • 1





                That is correct _module.less overrides the parent less file, there is no inheritance or merging. I realise I could have made that more clear in my original answer :)

                – c.norin
                Dec 15 '16 at 12:24






              • 1





                @MattCosentino I realise this reply comes very late, but I'll leave this here in case someone stumbles upon it: Please note the difference between _extends.less and _extend.less. The _extend.less files can be added to any module context, to extend styles from a parent theme. The _extends.less is located in the root of the theme and is used to extend existing utilities (refer to <project>/lib/web/css/docs/source/_utilities.less).

                – c.norin
                Jan 15 '18 at 17:01







              1




              1





              I've read that but it doesn't really explain why, it sounds like there's no reasoning behind it. I'm trying to figure out if there's any difference. I've been using _extend.less for all my changes as I prefer consistency to using something because 'Magento said so'.

              – Ben Crook
              May 23 '16 at 6:41





              I've read that but it doesn't really explain why, it sounds like there's no reasoning behind it. I'm trying to figure out if there's any difference. I've been using _extend.less for all my changes as I prefer consistency to using something because 'Magento said so'.

              – Ben Crook
              May 23 '16 at 6:41




              1




              1





              @BenCrook if my reading these past few days serves me right, no. If someone were to add any .less file in their theme with the same path as a file in the parent theme/module, that is an override. You could probably verify by creating a blank _module.less into your theme, and seeing if the original styles apply.

              – Darren Felton
              Dec 14 '16 at 14:20





              @BenCrook if my reading these past few days serves me right, no. If someone were to add any .less file in their theme with the same path as a file in the parent theme/module, that is an override. You could probably verify by creating a blank _module.less into your theme, and seeing if the original styles apply.

              – Darren Felton
              Dec 14 '16 at 14:20




              1




              1





              After a php bin/magento setup:static-content:deploy, you can look into pub/static/frontend/<vendor>/<themeName>/<locale>/css/ and pub/static/frontend/<vendor>/<themeName>/<locale>/<Module_Name>/css/ and there will be symbolic links for *.less files to either your theme, or the module/parent theme it is coming from.

              – Darren Felton
              Dec 14 '16 at 14:23





              After a php bin/magento setup:static-content:deploy, you can look into pub/static/frontend/<vendor>/<themeName>/<locale>/css/ and pub/static/frontend/<vendor>/<themeName>/<locale>/<Module_Name>/css/ and there will be symbolic links for *.less files to either your theme, or the module/parent theme it is coming from.

              – Darren Felton
              Dec 14 '16 at 14:23




              1




              1





              That is correct _module.less overrides the parent less file, there is no inheritance or merging. I realise I could have made that more clear in my original answer :)

              – c.norin
              Dec 15 '16 at 12:24





              That is correct _module.less overrides the parent less file, there is no inheritance or merging. I realise I could have made that more clear in my original answer :)

              – c.norin
              Dec 15 '16 at 12:24




              1




              1





              @MattCosentino I realise this reply comes very late, but I'll leave this here in case someone stumbles upon it: Please note the difference between _extends.less and _extend.less. The _extend.less files can be added to any module context, to extend styles from a parent theme. The _extends.less is located in the root of the theme and is used to extend existing utilities (refer to <project>/lib/web/css/docs/source/_utilities.less).

              – c.norin
              Jan 15 '18 at 17:01





              @MattCosentino I realise this reply comes very late, but I'll leave this here in case someone stumbles upon it: Please note the difference between _extends.less and _extend.less. The _extend.less files can be added to any module context, to extend styles from a parent theme. The _extends.less is located in the root of the theme and is used to extend existing utilities (refer to <project>/lib/web/css/docs/source/_utilities.less).

              – c.norin
              Jan 15 '18 at 17:01













              1














              The _extends.less with an S at the end within the Blank Theme, is a file where they created all the classes that can be extended via LESS later within the theme, without the need of creating new components or modular structure for style changes. -> For those who don't believe me: https://github.com/magento/magento2/blob/2.3-develop/app/design/frontend/Magento/blank/web/css/source/_extends.less check the file.



              The _extend.less without the S at the end, is for when you are 99% happy with what the parent theme has and you just need to change a couple of things, change some styling and that's it.



              About the latter one, my personal opinion, don't use it for your own developing. It creates a big mess later. Keep your structure modular with _module.less for every module you want to customize and you will get a better outcome & maintainable project at the end.






              share|improve this answer





























                1














                The _extends.less with an S at the end within the Blank Theme, is a file where they created all the classes that can be extended via LESS later within the theme, without the need of creating new components or modular structure for style changes. -> For those who don't believe me: https://github.com/magento/magento2/blob/2.3-develop/app/design/frontend/Magento/blank/web/css/source/_extends.less check the file.



                The _extend.less without the S at the end, is for when you are 99% happy with what the parent theme has and you just need to change a couple of things, change some styling and that's it.



                About the latter one, my personal opinion, don't use it for your own developing. It creates a big mess later. Keep your structure modular with _module.less for every module you want to customize and you will get a better outcome & maintainable project at the end.






                share|improve this answer



























                  1












                  1








                  1







                  The _extends.less with an S at the end within the Blank Theme, is a file where they created all the classes that can be extended via LESS later within the theme, without the need of creating new components or modular structure for style changes. -> For those who don't believe me: https://github.com/magento/magento2/blob/2.3-develop/app/design/frontend/Magento/blank/web/css/source/_extends.less check the file.



                  The _extend.less without the S at the end, is for when you are 99% happy with what the parent theme has and you just need to change a couple of things, change some styling and that's it.



                  About the latter one, my personal opinion, don't use it for your own developing. It creates a big mess later. Keep your structure modular with _module.less for every module you want to customize and you will get a better outcome & maintainable project at the end.






                  share|improve this answer















                  The _extends.less with an S at the end within the Blank Theme, is a file where they created all the classes that can be extended via LESS later within the theme, without the need of creating new components or modular structure for style changes. -> For those who don't believe me: https://github.com/magento/magento2/blob/2.3-develop/app/design/frontend/Magento/blank/web/css/source/_extends.less check the file.



                  The _extend.less without the S at the end, is for when you are 99% happy with what the parent theme has and you just need to change a couple of things, change some styling and that's it.



                  About the latter one, my personal opinion, don't use it for your own developing. It creates a big mess later. Keep your structure modular with _module.less for every module you want to customize and you will get a better outcome & maintainable project at the end.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited May 2 at 21:19

























                  answered Mar 6 at 2:04









                  Ezequiel AlbaEzequiel Alba

                  1169




                  1169





















                      1














                      Simple explanation or difference between both:



                      _extend.less is the way to extend/modify parent themes styles for example you're happy with your parent theme Luma and just want to change the button styles in your custom theme, all you need to do is create a new file _buttons_extend.less under web/css/source in your custom theme and adjust styles in there. Register this file by adding it to the _extend.less file inside your theme directory.



                      What if you want to extend styles of a module e.g. checkout module, well you can create an _extend.less file inside your themes module folder e.g. Magento_Checkout/web/css/source/_extend.less and add/extend module styling in there.



                      Now if I added _module.less file inside my module directory Magento_Checkout/web/css/source/_module.less I'm intending to override my parent themes styling for this module in which case I need to copy '_module.less' file from my parent theme's module directory and make modification to that file in which case this file will replace parent themes _module.less file altogether.






                      share|improve this answer



























                        1














                        Simple explanation or difference between both:



                        _extend.less is the way to extend/modify parent themes styles for example you're happy with your parent theme Luma and just want to change the button styles in your custom theme, all you need to do is create a new file _buttons_extend.less under web/css/source in your custom theme and adjust styles in there. Register this file by adding it to the _extend.less file inside your theme directory.



                        What if you want to extend styles of a module e.g. checkout module, well you can create an _extend.less file inside your themes module folder e.g. Magento_Checkout/web/css/source/_extend.less and add/extend module styling in there.



                        Now if I added _module.less file inside my module directory Magento_Checkout/web/css/source/_module.less I'm intending to override my parent themes styling for this module in which case I need to copy '_module.less' file from my parent theme's module directory and make modification to that file in which case this file will replace parent themes _module.less file altogether.






                        share|improve this answer

























                          1












                          1








                          1







                          Simple explanation or difference between both:



                          _extend.less is the way to extend/modify parent themes styles for example you're happy with your parent theme Luma and just want to change the button styles in your custom theme, all you need to do is create a new file _buttons_extend.less under web/css/source in your custom theme and adjust styles in there. Register this file by adding it to the _extend.less file inside your theme directory.



                          What if you want to extend styles of a module e.g. checkout module, well you can create an _extend.less file inside your themes module folder e.g. Magento_Checkout/web/css/source/_extend.less and add/extend module styling in there.



                          Now if I added _module.less file inside my module directory Magento_Checkout/web/css/source/_module.less I'm intending to override my parent themes styling for this module in which case I need to copy '_module.less' file from my parent theme's module directory and make modification to that file in which case this file will replace parent themes _module.less file altogether.






                          share|improve this answer













                          Simple explanation or difference between both:



                          _extend.less is the way to extend/modify parent themes styles for example you're happy with your parent theme Luma and just want to change the button styles in your custom theme, all you need to do is create a new file _buttons_extend.less under web/css/source in your custom theme and adjust styles in there. Register this file by adding it to the _extend.less file inside your theme directory.



                          What if you want to extend styles of a module e.g. checkout module, well you can create an _extend.less file inside your themes module folder e.g. Magento_Checkout/web/css/source/_extend.less and add/extend module styling in there.



                          Now if I added _module.less file inside my module directory Magento_Checkout/web/css/source/_module.less I'm intending to override my parent themes styling for this module in which case I need to copy '_module.less' file from my parent theme's module directory and make modification to that file in which case this file will replace parent themes _module.less file altogether.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered May 2 at 22:25









                          DevtypeDevtype

                          2,25411333




                          2,25411333



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Magento Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f116248%2fdifference-between-module-less-and-extend-less%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                              Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                              Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form