Skip to content

Instantly share code, notes, and snippets.

@generatepress
Last active April 21, 2021 13:53
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save generatepress/793804f553c25c70823c to your computer and use it in GitHub Desktop.
Save generatepress/793804f553c25c70823c to your computer and use it in GitHub Desktop.
/* MENU ITEMS */
.main-navigation {
background-color: #222222;
}
.main-navigation .navigation-search input[type="search"],
.main-navigation .navigation-search input[type="search"]:active {
color: #FFFFFF;
background-color: #1e72bd;
}
.main-navigation .navigation-search input[type="search"]:focus {
color: #FFFFFF;
background-color: #1e72bd;
}
.main-navigation .main-nav ul li a,
.main-navigation .menu-toggle {
color: #FFFFFF;
}
/* SUB-NAVIGATION */
.main-navigation .main-nav ul ul li a {
background: #222222;
color: #FFFFFF;
}
/* MENU ITEM HOVER */
.main-navigation .main-nav ul li:hover > a,
.main-navigation .main-nav ul li:focus > a,
.main-navigation .main-nav ul li.sfHover > a {
color: #FFFFFF;
background-color: #1e72bd;
}
/* SUB-NAVIGATION HOVER */
.main-navigation .main-nav ul ul li:hover > a,
.main-navigation .main-nav ul ul li:focus > a,
.main-navigation .main-nav ul ul li.sfHover > a {
color: #FFFFFF;
background-color: #4f4f4f;
}
/* CURRENT ITEMS */
.main-navigation .main-nav ul li[class*="current-menu-"] > a {
color: #FFFFFF;
background-color: #1e72bd;
}
.main-navigation .main-nav ul li[class*="current-menu-"]:hover > a,
.main-navigation .main-nav ul li[class*="current-menu-"]:focus > a,
.main-navigation .main-nav ul li[class*="current-menu-"].sfHover > a {
color: #FFFFFF;
background-color: #1e72bd;
}
/* SUB-NAVIGATION CURRENT ITEMS */
.main-navigation .main-nav ul ul li[class*="current-menu-"] > a {
color: #FFFFFF;
background-color: #4f4f4f;
}
.main-navigation .main-nav ul ul li[class*="current-menu-"]:hover > a,
.main-navigation .main-nav ul ul li[class*="current-menu-"]:focus > a,
.main-navigation .main-nav ul ul li[class*="current-menu-"].sfHover > a {
color: #FFFFFF;
background-color: #4f4f4f;
}
@Krislynde
Copy link

Hi!

Thank you, this is helpful!
I just started using your theme (generatepress) and I feel very inspired! I like it very much!

Just noticed by using this for my customized menu, that the last bit of it misses some "ul"-s.
/* SUB-NAVIGATION CURRENT ITEMS / is exactly the same as / CURRENT ITEMS */

@alexczaragoza
Copy link

I have problem. please help me. I applied this code properly, but when I hover to my sub navigation menu it brings back the default color (brown) of the primary menu that the sub menu items belong to. Please help.

@alexczaragoza
Copy link

Here is the screenshot of the issue that I am encountering right now. Please help me. Tom please help me. Thank you in advance
hover issue

@elizabethdalessandro
Copy link

I am having the same issue as alexczaragoza. Does anybody know how to solve it please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment