- This topic has 14 replies, 3 voices, and was last updated 4 years, 4 months ago by
Ying.
-
AuthorPosts
-
November 15, 2021 at 10:14 pm #2005837
Brent Wilson
What CSS do I need to make the background behind the mobile menu hamburger icon change colour on hover?
November 15, 2021 at 10:34 pm #2005853Elvin
StaffCustomer SupportHi Brent,
On Appearance > Customize > Colors, you should see this option under Primary navigation – https://share.getcloudapp.com/jkuEOOnL
The middle option on the 3 circles is for the background color on hover but this will apply on both mobile and desktop.
If you only want to apply it on mobile, you’ll have to use custom CSS:
Example:
@media (max-width:768px){ .mobile-menu-control-wrapper .menu-toggle:hover { background-color: orange; } }But I think this style may be moot because there’s no “hover” on mobile devices as there’s no cursor/pointer on its UI. (only initial state and tap)
November 16, 2021 at 3:52 pm #2007108Brent Wilson
Okay, so would there be some css I could use to get it to go orange on tap for mobile?
November 16, 2021 at 5:47 pm #2007174Ying
StaffCustomer SupportHi Brent,
The CSS Elvin provided should work on tap for mobile as well.
Can you give it a try?
Let me know ๐
November 16, 2021 at 11:39 pm #2007314Brent Wilson
Okay. Also, where do I set the color for the mobile dropdown menu background? Now, on desktop view I have a white background that goes to yellowish orange on hover. But at widths where the hamburger icon shows, when I click on the hamburger, the dropdown menu seems to basically have a transparent background. When I hover over the options, then I get the correct hover background. But how do I get it to show a white background behind the menu text when not hovering?
November 17, 2021 at 12:16 am #2007339Elvin
StaffCustomer SupportYou can play around with this CSS:
@media (max-width:768px){ /* hamburger button colors */ html.mobile-menu-open button.menu-toggle { background-color: orange !important; } /* menu container colors */ nav#site-navigation { background-color: white !important; } /* menu item base color */ nav#site-navigation div#primary-menu ul li { background-color: white; } /* menu item on hover color */ nav#site-navigation div#primary-menu ul li:hover, nav#site-navigation div#primary-menu ul li:focus { background-color: orange; } }I’ve labeled the selectors so you know which one is doing what. ๐
November 17, 2021 at 9:58 am #2008188Brent Wilson
Can you watch this Loom video I recorded and give me your feedback regarding this? Thanks!
November 17, 2021 at 10:02 am #2008197Brent Wilson
Also, either or both of these bits of CSS seem to accomplish what I want. What is the difference between them? Can I just use one of them? Or do I need both? If only one, which one should I use?
@media (max-width:900px){ /* menu container colors */ nav#site-navigation { background-color: white !important; } /* menu item base color */ nav#site-navigation div#primary-menu ul li { background-color: white; } }November 17, 2021 at 11:57 am #2008351Ying
StaffCustomer SupportHi Brent,
You have this CSS on your site which makes the background of primary navigation transparent, it seems a cache file, but I could be wrong.
https://www.screencast.com/t/3FTgXZbGCould you try clear all cache including server cache and keep all cache plugins deactivated so we can see how the CSS gets there.
Let me know ๐
For the CSS question, you can use either of them.
November 17, 2021 at 12:14 pm #2008371Brent Wilson
Okay, caching should be cleared and turned off now. That bit of CSS still seems to be there. Is that not put there by some setting somewhere in the customizer?
November 17, 2021 at 12:53 pm #2008417Ying
StaffCustomer SupportWhen
site headerandprimary navigationhave the same background color, it will trigger the theme to add a semi transparent color to the primary navigation.Can you go to customizer > colors try set the background color for
headerto any other color instead ofvar(--white)?Let me know ๐
November 17, 2021 at 1:38 pm #2008463Brent Wilson
Okay, I changed the header background color, and it seems to have fixed the issue. Is this a bug, or is it designed to be helpful with a standard header that isn’t merged with content?
November 17, 2021 at 1:56 pm #2008480Ying
StaffCustomer SupportIt should be helpful with standard layout without merged header. But I will definitely mention this to Tom ๐
November 17, 2021 at 2:16 pm #2008494Brent Wilson
Sounds good! Thanks for your help on this issue!
November 17, 2021 at 3:10 pm #2008527Ying
StaffCustomer SupportYou are welcome ๐
-
AuthorPosts
- You must be logged in to reply to this topic.