Alston,
For some reason, my previous post was deleted and it was extensive so I'm writing it up again without a couple of comments about the Gantry Framework.
If you look at the source code for your website, this is what you will see:
<body class="logo-type-custom headerstyle-dark font-family-helvetica font-size-is-default menu-type-dropdownmenu layout-mode-responsive col12 option-com-content menu-home ">
Notice the '
headerstyle-dark' class. If you open up your Gantry template in the Template Manager, look under the Style tab, you'll see that the Style is set to 'Dark'. There is a 'Light' option that will set the class as '
headerstyle-light' class. You can actually use this to create two completely different website styles.
Now this gets a bit tricky but here is how you can do it. Now you have already created your new 'mobile-menu' as you've put it in a 'header' module position.
- Go to the Template Manager
- Click the checkbox next to your default gantry template
- Click the Duplicate button above. You should see a 'gantry - Default (2)' template.
- Open the duplicated template and change the Style Name to 'Gantry - Mobile'. This is only for display purposes but it will help keep your mind clear on what you're working on.
- Click the Style tab
- Click the checkbox next to the Header Style
- Click the down arrow and select 'Light'
- Click the Assignments taba
- Click all checkboxes on your 'mainmenu-mobile' menu.
- Click Save & Close
- Now open up a browser, reduce the width until the 'mobile' menu appears, right-click and View Source or use the developer tools to see the HTML code.
- Look at the BODY tag. It should have this code:
- <body class="logo-type-custom headerstyle-light font-family-helvetica font-size-is-default menu-type-dropdownmenu layout-mode-responsive col12 option-com-content menu-home ">
- If you see 'headerstyle-light' instead of 'headerstyle-dark', that's good!
- Now increase the width of your browser until the mobile menu / horizontal menu is replaced by the vertical menu.
- Again, look at the HTML code and if 'headerstyle-dark' is in the BODY tag. You're in business!
With these classes, you can create different looks for different elements.
Example:
Your current gantry-custom.css file does not have any '.headerstyle-dark' classes. The first order of business is to detemine what needs to remain the same on both "large | desktop" as well as "tablet | phone". Any CSS that will not be changed does not need the 'headerstyle' type to preface the CSS declaration.
Example:
If you want your mainbody-surround background to be '#ffffff" (white) on all displays, then leave it alone.
#rt-mainbody-surround {
background-color: #FFFFFF;
}
On the other hand, let's say you want the "large | desktop" 'mainbody-surround' background to be #ffffff (white) but you want it to be #cccccc (light-gray) on "tablet | phone". Here is how you would do it. Add '.headerstyle-dark' in front of the '#rt-mainbody-surround". Copy and paste it below the first declaration but change the 'headerstyle-dark' to 'headerstyle-light' and the '#FFFFFF' to '#CCCCCC'.
.headerstyle-dark #rt-mainbody-surround {
background-color: #FFFFFF;
}
.headerstyle-light #rt-mainbody-surround {
background-color: #CCCCCC;
}
Make this one simple change, then view the site in desktop mode and then 'slightly' change the width to 'tablet' width where the horizontal menu appears. The background should change to light gray. If it does, you now know how to make style changes for mobile. Simply prefix any declaration with '.headerstyle-light' and that will only appear on mobile displays. Anything prefix with '.headerstyle-dark' will only show on 'non-mobile' displays.
I hope this helps you!
Luke