Optimizing Your Shopify Mobile Menu: Smaller Fonts & Login/Sign Up Buttons with Custom Code
Hey there, fellow store owners! As a Shopify expert, I spend a lot of time digging through the community forums. Recently, I was following a fantastic discussion that really highlighted how powerful a little custom code can be for improving your store's mobile experience. The original post by `veluxe1` was all about tweaking the mobile menu drawer – specifically, making the font size smaller and adding some handy Login and Sign Up buttons. The good news? The community came through with brilliant, app-free solutions!
Your mobile menu drawer is a critical touchpoint. If it's clunky or missing key elements, you could be losing sales. `veluxe1`'s goal was spot-on: optimize for readability and user convenience. A smaller font makes a busy menu less overwhelming, and direct login/signup access streamlines the customer journey.
The Shopify community is amazing at pitching in. Experts like `markjohn1`, `WebsiteDeveloper`, `suyash1`, `Moeed`, and especially `devcoders` jumped in to help `veluxe1` (who was using the Horizon theme, but these principles apply broadly!). They broke down exactly how to achieve these customizations without needing an extra app.
tag of the main drawer content, and paste this code. It intelligently displays "My Account" if a customer is logged in, or "Login" and "Sign Up" if they're not.Part 1: Shrinking Those Mobile Menu Fonts
Let's tackle that font size. CSS is your friend here for this visual change, living in your theme's stylesheet.- Access Your Theme Code: From your Shopify admin, go to Online Store > Themes.
- Edit Code: Find your current theme, click Actions, then select Edit Code.
- Locate Your CSS File: In the Assets folder, look for
base.css(a common spot for general styling). - Add the CSS: Scroll to the very bottom and paste this. This media query ensures changes only apply on smaller screens (under 749px).
@media screen and (max-width: 749px) { .menu-drawer__menu-item--mainlist .menu-drawer__menu-item-text { font-size: 14px !important; } .menu-drawer__menu-item--child .menu-drawer__menu-item-text { font-size: 12px !important; } } - Save Your Changes: Click Save.
Feel free to adjust the font-size values (e.g., 12px or 10px) to get your desired look. The !important flag helps override existing theme styles.
Part 2: Adding Essential Login & Sign Up Buttons
Next, adding those crucial login and signup buttons. This involves a bit of Liquid for the HTML structure and then some CSS for styling.Step A: Adding the HTML Structure
You'll need to locate the Liquid file responsible for your mobile menu drawer. Common names areheader-drawer.liquid or menu-drawer.liquid, usually found in the Sections folder.
- Locate the Drawer File: In your theme code editor, navigate to the Sections folder and open
header-drawer.liquidormenu-drawer.liquid(or a similar file). - Paste the HTML (Liquid): Scroll towards the bottom of the file, just before the closing
Step B: Styling Your New Buttons
Now, let's make them look good! We'll add CSS to the samebase.css file.
- Revisit Your CSS File: Go back to
Assets/base.css. - Add Button Styling CSS: Paste this code at the very bottom, after your font size adjustments.
.mobile-auth-buttons { display: flex; gap: 10px; padding: 20px; } .auth-btn { flex: 1; text-align: center; padding: 12px; border: 1px solid #000; text-decoration: none; } .signup-btn { background: #000; color: #fff; } - Save Your Changes: Click Save.
This CSS uses Flexbox for side-by-side buttons, adds padding, a border, and styles the "Sign Up" button.
Here's a visual of what `devcoders` shared, showing how these buttons can look:

Step C: Making Those Buttons Nicely Rounded
`veluxe1` had a great follow-up: how to make those sharp button edges a bit softer? Another quick CSS tweak!- Revisit Your CSS File: Head back to
Assets/base.css. - Add Border Radius: Find the
.auth-btnCSS block you just added and insertborder-radius: 12px;within it. If adding separately, ensure it's at the bottom ofbase.css..auth-btn { flex: 1; text-align: center; padding: 12px; border: 1px solid #000; text-decoration: none; border-radius: 12px; /* Add this line! */ } - Save Your Changes: Click Save.
Adjust the 12px value for more or less rounding.