Mobile menu breakpoint in Magento 2












3















How do you change the breakpoint at which mobile menu appears in Magento 2?










share|improve this question























  • this link may help.

    – Milan Chandro
    Jun 6 '18 at 10:41
















3















How do you change the breakpoint at which mobile menu appears in Magento 2?










share|improve this question























  • this link may help.

    – Milan Chandro
    Jun 6 '18 at 10:41














3












3








3


3






How do you change the breakpoint at which mobile menu appears in Magento 2?










share|improve this question














How do you change the breakpoint at which mobile menu appears in Magento 2?







magento2 menu






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 1 '16 at 12:42









DevtypeDevtype

2,09911231




2,09911231













  • this link may help.

    – Milan Chandro
    Jun 6 '18 at 10:41



















  • this link may help.

    – Milan Chandro
    Jun 6 '18 at 10:41

















this link may help.

– Milan Chandro
Jun 6 '18 at 10:41





this link may help.

– Milan Chandro
Jun 6 '18 at 10:41










3 Answers
3






active

oldest

votes


















4














You have to replace style in webcsssource _navigation.less in your custom theme.



For Desktop



.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {


to (your custom width)



@media only screen and (min-width: 1024px) {




And for Mobile



.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {


to (your custom width)



 @media only screen and (max-width: 1023px) {


Remember one thing you have to add max-width is -1 from min-width.






share|improve this answer































    5














    The JS for the menu that has that functionality can be found in




    lib/web/mage/menu.js




    First create the folder structure in your theme ex:




    [Namespace]/[theme_name]/web/mage/




    And copy menu.js from lib/web/mage/menu.js to [Namespace]/[theme_name]/web/mage/menu.js



    And change



     mediaBreakpoint: '(max-width: 768px)'


    to



    mediaBreakpoint: '(max-width: 1025px)'


    And copy css from mobile and write specific brakpoint






    share|improve this answer

































      0














      Another approach is to overide the value in your theme of the @screen__m LESS variable. But this will not only change the mobile breakpoint for the navigation, it will change the mobile breakpoint everywhere.



      Add to your theme's _extend.less



      @screen__m: 960px;


      Also, for best performace results you should add the following file to your theme



      Magento_Theme/layout/default_head_blocks.xml



      <?xml version="1.0"?>
      <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
      <head>
      <css src="css/styles-l.css" media="screen and (min-width: 960px)"/>
      </head>
      </page>


      For more info see:
      https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/responsive-web-design/rwd_css.html






      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%2f143519%2fmobile-menu-breakpoint-in-magento-2%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









        4














        You have to replace style in webcsssource _navigation.less in your custom theme.



        For Desktop



        .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {


        to (your custom width)



        @media only screen and (min-width: 1024px) {




        And for Mobile



        .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {


        to (your custom width)



         @media only screen and (max-width: 1023px) {


        Remember one thing you have to add max-width is -1 from min-width.






        share|improve this answer




























          4














          You have to replace style in webcsssource _navigation.less in your custom theme.



          For Desktop



          .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {


          to (your custom width)



          @media only screen and (min-width: 1024px) {




          And for Mobile



          .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {


          to (your custom width)



           @media only screen and (max-width: 1023px) {


          Remember one thing you have to add max-width is -1 from min-width.






          share|improve this answer


























            4












            4








            4







            You have to replace style in webcsssource _navigation.less in your custom theme.



            For Desktop



            .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {


            to (your custom width)



            @media only screen and (min-width: 1024px) {




            And for Mobile



            .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {


            to (your custom width)



             @media only screen and (max-width: 1023px) {


            Remember one thing you have to add max-width is -1 from min-width.






            share|improve this answer













            You have to replace style in webcsssource _navigation.less in your custom theme.



            For Desktop



            .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {


            to (your custom width)



            @media only screen and (min-width: 1024px) {




            And for Mobile



            .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {


            to (your custom width)



             @media only screen and (max-width: 1023px) {


            Remember one thing you have to add max-width is -1 from min-width.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 14 '16 at 9:04









            Dipesh RanganiDipesh Rangani

            1,8012931




            1,8012931

























                5














                The JS for the menu that has that functionality can be found in




                lib/web/mage/menu.js




                First create the folder structure in your theme ex:




                [Namespace]/[theme_name]/web/mage/




                And copy menu.js from lib/web/mage/menu.js to [Namespace]/[theme_name]/web/mage/menu.js



                And change



                 mediaBreakpoint: '(max-width: 768px)'


                to



                mediaBreakpoint: '(max-width: 1025px)'


                And copy css from mobile and write specific brakpoint






                share|improve this answer






























                  5














                  The JS for the menu that has that functionality can be found in




                  lib/web/mage/menu.js




                  First create the folder structure in your theme ex:




                  [Namespace]/[theme_name]/web/mage/




                  And copy menu.js from lib/web/mage/menu.js to [Namespace]/[theme_name]/web/mage/menu.js



                  And change



                   mediaBreakpoint: '(max-width: 768px)'


                  to



                  mediaBreakpoint: '(max-width: 1025px)'


                  And copy css from mobile and write specific brakpoint






                  share|improve this answer




























                    5












                    5








                    5







                    The JS for the menu that has that functionality can be found in




                    lib/web/mage/menu.js




                    First create the folder structure in your theme ex:




                    [Namespace]/[theme_name]/web/mage/




                    And copy menu.js from lib/web/mage/menu.js to [Namespace]/[theme_name]/web/mage/menu.js



                    And change



                     mediaBreakpoint: '(max-width: 768px)'


                    to



                    mediaBreakpoint: '(max-width: 1025px)'


                    And copy css from mobile and write specific brakpoint






                    share|improve this answer















                    The JS for the menu that has that functionality can be found in




                    lib/web/mage/menu.js




                    First create the folder structure in your theme ex:




                    [Namespace]/[theme_name]/web/mage/




                    And copy menu.js from lib/web/mage/menu.js to [Namespace]/[theme_name]/web/mage/menu.js



                    And change



                     mediaBreakpoint: '(max-width: 768px)'


                    to



                    mediaBreakpoint: '(max-width: 1025px)'


                    And copy css from mobile and write specific brakpoint







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Mar 30 '18 at 12:35









                    Piyush

                    4,78872053




                    4,78872053










                    answered Mar 30 '18 at 12:25









                    MHK DeveloperMHK Developer

                    9916




                    9916























                        0














                        Another approach is to overide the value in your theme of the @screen__m LESS variable. But this will not only change the mobile breakpoint for the navigation, it will change the mobile breakpoint everywhere.



                        Add to your theme's _extend.less



                        @screen__m: 960px;


                        Also, for best performace results you should add the following file to your theme



                        Magento_Theme/layout/default_head_blocks.xml



                        <?xml version="1.0"?>
                        <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                        <head>
                        <css src="css/styles-l.css" media="screen and (min-width: 960px)"/>
                        </head>
                        </page>


                        For more info see:
                        https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/responsive-web-design/rwd_css.html






                        share|improve this answer






























                          0














                          Another approach is to overide the value in your theme of the @screen__m LESS variable. But this will not only change the mobile breakpoint for the navigation, it will change the mobile breakpoint everywhere.



                          Add to your theme's _extend.less



                          @screen__m: 960px;


                          Also, for best performace results you should add the following file to your theme



                          Magento_Theme/layout/default_head_blocks.xml



                          <?xml version="1.0"?>
                          <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                          <head>
                          <css src="css/styles-l.css" media="screen and (min-width: 960px)"/>
                          </head>
                          </page>


                          For more info see:
                          https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/responsive-web-design/rwd_css.html






                          share|improve this answer




























                            0












                            0








                            0







                            Another approach is to overide the value in your theme of the @screen__m LESS variable. But this will not only change the mobile breakpoint for the navigation, it will change the mobile breakpoint everywhere.



                            Add to your theme's _extend.less



                            @screen__m: 960px;


                            Also, for best performace results you should add the following file to your theme



                            Magento_Theme/layout/default_head_blocks.xml



                            <?xml version="1.0"?>
                            <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                            <head>
                            <css src="css/styles-l.css" media="screen and (min-width: 960px)"/>
                            </head>
                            </page>


                            For more info see:
                            https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/responsive-web-design/rwd_css.html






                            share|improve this answer















                            Another approach is to overide the value in your theme of the @screen__m LESS variable. But this will not only change the mobile breakpoint for the navigation, it will change the mobile breakpoint everywhere.



                            Add to your theme's _extend.less



                            @screen__m: 960px;


                            Also, for best performace results you should add the following file to your theme



                            Magento_Theme/layout/default_head_blocks.xml



                            <?xml version="1.0"?>
                            <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                            <head>
                            <css src="css/styles-l.css" media="screen and (min-width: 960px)"/>
                            </head>
                            </page>


                            For more info see:
                            https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/responsive-web-design/rwd_css.html







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Jan 15 at 13:55

























                            answered Jan 15 at 13:25









                            HollyHolly

                            2,24233371




                            2,24233371






























                                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%2f143519%2fmobile-menu-breakpoint-in-magento-2%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

                                William S. Burroughs

                                Eda skans

                                1924