Moving logo and burger menu mobile

Solved
Highlighted
New Member
7 0 0

Hello, 

I am using the Palo Alto theme and I would like to make the following changes to the header menu on mobile: 

-Centre my logo (vs. on the left) 

-Move the burger menu on the left (vs. on the right) 

Would be great to know which code I need to amend / add to do that. 

Thank you for your help. 

Regards, 

Lea. 

Capture d’écran 2020-10-29 à 18.02.06.png

0 Likes
Highlighted
Trailblazer
307 74 86

Hi @Leadermar 

Thanks Welcome to the Shopify community!
1. Go to Online Store->Themes->Edit code
2. Asset->/theme.scss.liquid->paste below code at the bottom of the file.

.site-header__logo {
    position: absolute;
    right: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    top: 50%;
}
.site-header__logo-link {
    display: inline-block;
    width: 100%;
    padding: 0;
}
button.js-drawer-open-left {
    position: absolute;
    left: 0;
}
If helpful then please Like and Accept Solution.
-Want to modify or custom changes on store Hire me.
- Feel free to contact me on vikaschovatiya02@gmail.com regarding any help
If you are happy and want to donate small Click here (Its my paypal)
0 Likes
Highlighted
New Member
7 0 0

Hello @Vikas_Chovatiya

Thank you so much for your answer. 

I tried to add this code at the bottom of file but doesn't seem to work - not sure if I did it properly? 

Thank you! 

<!doctype html>
  <!--[if IE 8]><html class="no-js ie9 lt-ie9" lang="en"> <![endif]-->
  <!--[if IE 9 ]><html class="ie9 no-js"> <![endif]-->
  <!--[if !IE]><!--><html class="not-ie no-js"><!--<![endif]-->
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    {%- if settings.favicon != blank -%}
      <link rel="shortcut icon" href="{{ settings.favicon | img_url: '32x32'}}" type="image/png" />
    {%- endif -%}

    {% comment %} Title and description {% endcomment %}
    <title>
    {{ page_title }}{% if current_tags %}{% assign meta_tags = current_tags | join: ', ' %} &ndash; {{ 'general.meta.tags' | t: tags: meta_tags }}{% endif %}{% if current_page != 1 %} &ndash; {{ 'general.meta.page' | t: page: current_page }}{% endif %}{% unless page_title contains shop.name %} &ndash; {{ shop.name }}{% endunless %}
    </title>

    {%- if page_description -%}
    <meta name="description" content="{{ page_description | escape }}">
    {%- endif -%}

    {% comment %} Helpers {% endcomment %}
    <link rel="canonical" href="{{ canonical_url }}">
    <meta name="viewport" content="width=device-width,initial-scale=1">

    {{ content_for_header }}

    {% comment %} CSS {% endcomment %}
    {{- 'theme.scss.css' | asset_url | stylesheet_tag -}}
  </head>

{%- capture body_class -%}
template-{{ template | replace: '.', ' ' | truncatewords: 1, '' | handle }} no-outline
{% if customer %} customer-logged-in{% endif %}
{% if settings.show_spacer_lines %} body--show-spacer-lines{% else %} body--hide-spacer-lines{% endif %}
{% if settings.quick_button == 'buy' %} quick-buy-enabled{% elsif settings.quick_button == 'view' %} quick-view-enabled{% endif %}
{% unless settings.show_buttons_animation %} no-button-animation{% endunless %}
{%- endcapture -%}

  <body id="{{ page_title | handle }}" class="{{ body_class | strip_newlines | strip }}">
    <div class="block-body"></div>
    <a class="in-page-link skip-link" href="#MainContent">{{ 'general.accessibility.skip_to_content' | t }}</a>

    {%- section 'popup' -%}
    {%- section 'announcement-bar' -%}
    {%- section 'header' -%}

    <div id="PageContainer" class="is-moved-by-drawer">

      <main id="MainContent" class="main-content" role="main">
        {{ content_for_layout }}
      </main>
      {%- section 'footer' -%}

    </div>

    {%- render 'scripts' -%}
    
    .site-header__logo {
    position: absolute;
    right: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    top: 50%;
}
.site-header__logo-link {
    display: inline-block;
    width: 100%;
    padding: 0;
}
button.js-drawer-open-left {
    position: absolute;
    left: 0;
}

</body>
</html>

 

.site-header__logo {
    position: absolute;
    right: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    top: 50%;
}
.site-header__logo-link {
    display: inline-block;
    width: 100%;
    padding: 0;
}
button.js-drawer-open-left {
    position: absolute;
    left: 0;
}
0 Likes
Highlighted
Trailblazer
307 74 86

Hi @Leadermar 

You add the wrong place please add this file theme.scss.liquid

If helpful then please Like and Accept Solution.
-Want to modify or custom changes on store Hire me.
- Feel free to contact me on vikaschovatiya02@gmail.com regarding any help
If you are happy and want to donate small Click here (Its my paypal)
0 Likes
Highlighted
New Member
7 0 0

@Vikas_Chovatiya

Ah yes indeed! Thank you, it's working now! 

Just one more thing, when I click on the menu, the burger menu is still displaying on the right side. Is there a way I can have the burger menu on the left side as well? 

Thank you so much for your help, 

Lea.

 Capture d’écran 2020-10-30 à 14.16.43.png

0 Likes
Highlighted
Trailblazer
307 74 86

This is an accepted solution.

Hi @Leadermar 

1. Go to Online Store->Themes->Edit code
2. Asset->/theme.scss.liquid->paste below code at the bottom of the file.

.js-drawer-open-left .is-moved-by-drawer {
    -moz-transform: translateX(300px);
    -o-transform: translateX(300px);
    -ms-transform: translateX(300px);
    -webkit-transform: translateX(300px);
    transform: translateX(300px);
}
.js-drawer-open-left .drawer--left {
    display: block;
    -moz-transform: translateX(300px);
    -o-transform: translateX(300px);
    -ms-transform: translateX(300px);
    -webkit-transform: translateX(300px);
    transform: translateX(300px);
}
#NavDrawer button {
    float: left;
    right: 0;
    left: 0;
    padding: 0;
}
.drawer--left {
    width: 300px;
    right: auto;
    border-left: 1px solid #f2f2f2;
    left: -300px;
    border-right: 2px solid #000;
}
If helpful then please Like and Accept Solution.
-Want to modify or custom changes on store Hire me.
- Feel free to contact me on vikaschovatiya02@gmail.com regarding any help
If you are happy and want to donate small Click here (Its my paypal)
Highlighted
New Member
7 0 0

It's working perfectly fine now, thank you so much for your help @Vikas_Chovatiya ! 

0 Likes
Highlighted
New Member
7 0 0

Hi @Vikas_Chovatiya

Actually I noticed that I have now 2 logos on my mobile header (except for the home page)

Capture d’écran 2020-10-30 à 16.00.56.png

0 Likes
Highlighted
Trailblazer
307 74 86

Hi @Leadermar 

It can be done by doing some code customization.
Please take the help of a developer and hire Shopify Expert or me

If helpful then please Like and Accept Solution.
-Want to modify or custom changes on store Hire me.
- Feel free to contact me on vikaschovatiya02@gmail.com regarding any help
If you are happy and want to donate small Click here (Its my paypal)
0 Likes
Highlighted
New Member
7 0 0

Hi @Vikas_Chovatiya , 

Actually it doesn't work and impacted my desktop header  

Thanks , 
Lea. Capture d’écran 2020-10-30 à 19.51.33.png

0 Likes