Solved Templates

Change Group Title Active Color

Asked by Peter Dowse 3 years ago Last activity 2 years ago

Hi Guys,

Using the Sphere template and I would like to change the colour of active sp-group-title however it appears as though this class isn't allocated to these menu items.

How would I go about changing these menu item active colours?
Website address is https://usng02.directrouter.com/~wwmvqgmg/

Accepted answer

Marked as the solution
Peter Dowse Asked this

I have found a work around to this issue - I've added the following code to my custom CSS

[aria-current="page"] {
  /* Your styles here */
}

and this has styled that 'active' menu item that's been given the sp-group-title class but not allocated as 'active'.

Mehtaz Afsana Borsha Staff

Thanks for sharing.

18 more replies

Mehtaz Afsana Borsha Staff

Hi

Thanks for contacting us. You can use this custom CSS


.sp-megamenu-parent>li.active>a{
  color:red !important;
}
.sp-megamenu-parent>li:after {
    background: red !important;
}

Go to system--> https://prnt.sc/tDbSUJh6LiGu --> Default template-->Template options--> https://prnt.sc/A5nlsBvCQsqs And add your CSS there.

-Regards.

Peter Dowse Asked this

That's great and thankyou however, that changes the main menu items.

Apologies - I should have specified that I require the dropdown menus to be a different colour.

Mehtaz Afsana Borsha Staff

Hi

Use this CSS for dropdown menu color

.sp-megamenu-parent .sp-dropdown li.sp-menu-item>a {
    color: blue !important;
}
.sp-megamenu-parent .sp-mega-group>li>a {
    color: #2a7ea1!important;

}
Peter Dowse Asked this

Again - I appreciate this answer however, this is for the general menu items, not the active menu.

I'm looking for a way to change the colour of the 'active' menu items in the dropdown.

I've tried several variations of adding :active and .current to the CSS classes, but nothing seems to want to work.

See this image for further explanation

Peter Dowse Asked this

Yes - I have the HEX code in there - but unfortunately the system isn't picking this up.

I believe this solution works for general drop down menus as it adds the class "sp-menu-item current-item active" to them, however these are Menu item headers using the mega menu structure, so the class is "item-180 menu_item item-header" - Hence why there seems to be no way to make the active colour work.

Mehtaz Afsana Borsha Staff

Try this CSS in your custom.css file

.sp-megamenu-parent .sp-mega-group>li>a:active {
    color: #3daf2c !important;
}
Peter Dowse Asked this

I've now added this and unfortunately this doesn't work :-(

Mehtaz Afsana Borsha Staff

Clear your joomla and browser cache then check again.

Peter Dowse Asked this

Done - tested and still not working.

Usually an active menu will have classes (like active) added to it when clicked.
There's no class added to Menu item headers using the mega menu structure to differentiate them as active, therefore targeting them with any :active CSS, I can't see working.

Any other ideas or is this something the Dev's will need to update in thye next round of template updates?

Mehtaz Afsana Borsha Staff

I need to inform my team, allow me some time please.

Peter Dowse Asked this

Ok - thank you. Apprecite you looking into it further.

Mehtaz Afsana Borsha Staff

Thanks, allow me some time please, I have to talk with my team.

Log in to reply.