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

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

                              Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                              Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?