Magento 2 extend styles-m.lessMagento, RWD, Form Styles, and Dynamic ContentCE 1.9.2.1 - Extend RWD Menustyles are not applied Custom theme is copied to rwd/defaultOverriding Blank Theme Styles in Magento 2Why styles are not getting applies when edited in magento2Extend part .less fileCustom styles not work in new theme Magento 2Magento media queries in platform-Responsive emailsMagento 2.2.5 styles-m.css and styles-l.css not loadM2 css/less priorities

'sudo apt-get update' get a warning

First amendment and employment: Can an employer terminate you for speech?

When do triples have been called monads for the first time?

Is it incorrect to write "I rate this book a 3 out of 4 stars?"

What is my malfunctioning AI harvesting from humans?

Infeasibility in mathematical optimization models

Is refreshing multiple times a test case for web applications?

Write an interpreter for *

Plausibility of Ice Eaters in the Arctic

Why does Intel's Haswell chip allow FP multiplication to be twice as fast as addition?

Best gun to modify into a monsterhunter weapon?

Non-OR journals which regularly publish OR research

How would I as a DM create a smart phone-like spell/device my players could use?

Why did the RAAF procure the F/A-18 despite being purpose-built for carriers?

English - Acceptable use of parentheses in an author's name

Drawing complex inscribed and circumscribed polygons in TikZ

Why doesn't the "ch" pronunciation rule occur for words such as "durch" and "manchmal"?

Can I call myself an assistant professor without a PhD?

Why level 0 espers are considered espers if they have no powers at all?

Word or idiom defining something barely functional

In a topological space if there exists a loop that cannot be contracted to a point does there exist a simple loop that cannot be contracted also?

Why did Gandalf use a sword against the Balrog?

Author changing name

Accidentals - some in brackets, some not



Magento 2 extend styles-m.less


Magento, RWD, Form Styles, and Dynamic ContentCE 1.9.2.1 - Extend RWD Menustyles are not applied Custom theme is copied to rwd/defaultOverriding Blank Theme Styles in Magento 2Why styles are not getting applies when edited in magento2Extend part .less fileCustom styles not work in new theme Magento 2Magento media queries in platform-Responsive emailsMagento 2.2.5 styles-m.css and styles-l.css not loadM2 css/less priorities






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








0















I'm working on a custom Magento 2 theme and I added couple of my own elements in it. When I write (for example):



.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) 
.example_elementwidth:100px;

.example_elementwidht:200px;


The code from media query is always overwritten by code below. I'm writing this code in my _theme.less file and it ends up in style-m.css. Yes I can use !important - but that is not the idea. I would like to know where do I need to write my responsive css / less code in order to work properly.



Thank you!










share|improve this question
































    0















    I'm working on a custom Magento 2 theme and I added couple of my own elements in it. When I write (for example):



    .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) 
    .example_elementwidth:100px;

    .example_elementwidht:200px;


    The code from media query is always overwritten by code below. I'm writing this code in my _theme.less file and it ends up in style-m.css. Yes I can use !important - but that is not the idea. I would like to know where do I need to write my responsive css / less code in order to work properly.



    Thank you!










    share|improve this question




























      0












      0








      0








      I'm working on a custom Magento 2 theme and I added couple of my own elements in it. When I write (for example):



      .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) 
      .example_elementwidth:100px;

      .example_elementwidht:200px;


      The code from media query is always overwritten by code below. I'm writing this code in my _theme.less file and it ends up in style-m.css. Yes I can use !important - but that is not the idea. I would like to know where do I need to write my responsive css / less code in order to work properly.



      Thank you!










      share|improve this question
















      I'm working on a custom Magento 2 theme and I added couple of my own elements in it. When I write (for example):



      .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) 
      .example_elementwidth:100px;

      .example_elementwidht:200px;


      The code from media query is always overwritten by code below. I'm writing this code in my _theme.less file and it ends up in style-m.css. Yes I can use !important - but that is not the idea. I would like to know where do I need to write my responsive css / less code in order to work properly.



      Thank you!







      magento2 layout less rwd






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 31 at 4:42









      Mohit Rane

      1,20918 bronze badges




      1,20918 bronze badges










      asked Dec 5 '16 at 14:52









      Filip Kunjadić - ĆulibrkFilip Kunjadić - Ćulibrk

      163 bronze badges




      163 bronze badges























          2 Answers
          2






          active

          oldest

          votes


















          0














          Try this



          .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) 
          .example_elementwidth:100px;

          .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m)
          .example_elementwidht:200px;






          share|improve this answer
































            0














            This goes in style-m.css, that generates the common and mobile styles



            & when (@media-common = true) 
            .example_element
            width:100px;




            This goes in style-l.css, that generates the desktop styles (Up to 768px)



            .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) 
            .example_element
            width:200px;




            The mobile first approach is better so mobile devices don't even load the desktop styles.



            Here the doc






            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%2f148905%2fmagento-2-extend-styles-m-less%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              Try this



              .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) 
              .example_elementwidth:100px;

              .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m)
              .example_elementwidht:200px;






              share|improve this answer





























                0














                Try this



                .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) 
                .example_elementwidth:100px;

                .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m)
                .example_elementwidht:200px;






                share|improve this answer



























                  0












                  0








                  0







                  Try this



                  .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) 
                  .example_elementwidth:100px;

                  .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m)
                  .example_elementwidht:200px;






                  share|improve this answer













                  Try this



                  .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) 
                  .example_elementwidth:100px;

                  .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m)
                  .example_elementwidht:200px;







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 5 '17 at 20:47









                  JanuszJanusz

                  184 bronze badges




                  184 bronze badges


























                      0














                      This goes in style-m.css, that generates the common and mobile styles



                      & when (@media-common = true) 
                      .example_element
                      width:100px;




                      This goes in style-l.css, that generates the desktop styles (Up to 768px)



                      .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) 
                      .example_element
                      width:200px;




                      The mobile first approach is better so mobile devices don't even load the desktop styles.



                      Here the doc






                      share|improve this answer































                        0














                        This goes in style-m.css, that generates the common and mobile styles



                        & when (@media-common = true) 
                        .example_element
                        width:100px;




                        This goes in style-l.css, that generates the desktop styles (Up to 768px)



                        .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) 
                        .example_element
                        width:200px;




                        The mobile first approach is better so mobile devices don't even load the desktop styles.



                        Here the doc






                        share|improve this answer





























                          0












                          0








                          0







                          This goes in style-m.css, that generates the common and mobile styles



                          & when (@media-common = true) 
                          .example_element
                          width:100px;




                          This goes in style-l.css, that generates the desktop styles (Up to 768px)



                          .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) 
                          .example_element
                          width:200px;




                          The mobile first approach is better so mobile devices don't even load the desktop styles.



                          Here the doc






                          share|improve this answer















                          This goes in style-m.css, that generates the common and mobile styles



                          & when (@media-common = true) 
                          .example_element
                          width:100px;




                          This goes in style-l.css, that generates the desktop styles (Up to 768px)



                          .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) 
                          .example_element
                          width:200px;




                          The mobile first approach is better so mobile devices don't even load the desktop styles.



                          Here the doc







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Feb 5 '17 at 23:02

























                          answered Feb 5 '17 at 22:49









                          nuovecodenuovecode

                          4854 silver badges14 bronze badges




                          4854 silver badges14 bronze badges






























                              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%2f148905%2fmagento-2-extend-styles-m-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