- This topic has 20 replies, 6 voices, and was last updated 3 years, 2 months ago by
Ying.
-
AuthorPosts
-
January 30, 2022 at 4:06 am #2098833
Georgi
Hello,
I set the Primary Navigation Background color to purple and I thought this would work only on dekstop but I see that it has affected mobile too: https://prnt.sc/26lvsfq
Can the primary navigation background be purple only on PC devices?
January 30, 2022 at 7:09 am #2098946David
StaffCustomer SupportHi there,
can you share a link to your site, and let me know what color you want the Mobile header ?
January 30, 2022 at 8:56 am #2099192Georgi
Hi,
Yes. Info in private area. I want the mobile header to be white/transparent as it is as default. Only the dekstop header to be purple.
January 30, 2022 at 11:57 am #2099318Leo
StaffCustomer SupportCan you set the customizer option for the desktop color you want, then we can provide the CSS specifically for mobile?
Let me know ๐
January 30, 2022 at 12:04 pm #2099325Georgi
I’ve set the customizer option for dekstop.
January 30, 2022 at 6:56 pm #2099500Elvin
StaffCustomer SupportHi Georgi,
The quick and easy way to add a different background color for mobile-header would be this CSS:
@media (max-width:768px){ nav#mobile-header { background-color: red; } }Here’s how to add css – https://docs.generatepress.com/article/adding-css/
You can change red to your preferred color. ๐
Let us know if you need further help.
January 30, 2022 at 10:59 pm #2099608Georgi
Thanks, Elvin!
I added it to already existing CSS:
@media (max-width: 768px) { .main-navigation.has-branding .inside-navigation.grid-container { flex-wrap: nowrap; background-color: white; }It works, so I guess this is not a mistake I did it this way instead of separate CSS? If so you can mark the thread as resolved ๐
January 30, 2022 at 11:10 pm #2099613Elvin
StaffCustomer SupportAh yes that can work as well since
.main-navigationis also a selector(class) of #mobile-header.This should tidy things up. ๐
Marking this as resolved. Let us know if you need further help. ๐
January 30, 2022 at 11:19 pm #2099620Georgi
One more thing actually – I didn’t have working mobile menu and just fixed it by assigning an off canvas menu and noticed that its purple there too ๐ Can I make it white? https://prnt.sc/26m8abe
January 31, 2022 at 12:14 am #2099653Elvin
StaffCustomer SupportAh that’s one issue in using
.main-navigation.This particular CSS is used on BOTH the offcanvas menu and the mobile-header. That’s actually why I recommended using #mobile-header so it will specifically apply to the #mobile-header only. ๐
Considering reverting the change you’ve made on .main-navigation and apply the color through my suggested CSS. ๐
January 31, 2022 at 9:18 am #2100324Georgi
M, I reverted the change on .main-navigation and applied the color through your CSS but it didn’t affect the offcanvas menu. Only the mobile header.
January 31, 2022 at 7:23 pm #2100825Elvin
StaffCustomer SupportM, I reverted the change on .main-navigation and applied the color through your CSS but it didnโt affect the offcanvas menu. Only the mobile header.
Yes that was the intended behavior. Were you aiming for something else?
This would be the expected css your site should be using if you only want the color purple on the mobile-header and ensure the offcanvas has white.
@media (max-width:768px){ /* Mobile header bar */ nav#mobile-header { background-color: purple; } /* Off-Canvas panel */ nav#generate-slideout-menu .inside-navigation { flex-wrap: nowrap; background-color: white; } }January 31, 2022 at 11:01 pm #2100916Georgi
The goal is to have the mobile header and offcanvas white. With this CSS now it can be achieve. Thank you ๐
Another problem I’m facing is that the cart and search icons in the mobile header are white too so they cant be seen. How can I change their color specificaly for mobile header?
January 31, 2022 at 11:08 pm #2100918Elvin
StaffCustomer SupportYou can add this in on the @media rule for mobile.
nav#mobile-header .menu-bar-items span.gp-icon svg { fill: white; }January 31, 2022 at 11:24 pm #2100925Georgi
M, I actually can’t get it to work when adding it to this code:
@media (max-width:768px){ /* Mobile header bar */ nav#mobile-header { background-color: white; }Tried putting it several ways, none was successful.
-
AuthorPosts
- You must be logged in to reply to this topic.