Changing colour of submenu highlight... Moodle 2.0

Changing colour of submenu highlight... Moodle 2.0

by Miriam Laidlaw -
Number of replies: 11
Picture of Plugin developers

This has been stumping me for a couple of days, and I've looked in the docs... I would like to change the background colour of the highlight of submenu items (see picture below).

highlight

It is blue by default. Now, amongst various other things, the first thing I tried was changing the following code:

blue

Second line specifies that lovely blue is the hover background colour for submenuitem. I changed it to:

orange

and no joy. It still remains blue.

Ideas?

Average of ratings: -
In reply to Miriam Laidlaw

Re: Changing colour of submenu highlight... Moodle 2.0

by Miriam Laidlaw -
Picture of Plugin developers

Though looking at it set out like this, I can see that the blue in the code is not in fact the same blue as the highlight... so where is that blue hiding? Firebug and the CSS Moodle Theme Block have not helped.

angry

In reply to Miriam Laidlaw

Re: Changing colour of submenu highlight... Moodle 2.0

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Which theme are you using?

In reply to Joseph Rézeau

Re: Changing colour of submenu highlight... Moodle 2.0

by Miriam Laidlaw -
Picture of Plugin developers

I'm using the standard theme as a basis and editing that.

In reply to Miriam Laidlaw

Re: Changing colour of submenu highlight... Moodle 2.0

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

First thing that springs to mind Miriam, is to make sure you are editing a renamed copy of the standard theme - the actual standard theme should not be altered - your changes may get overwritten on any future upgrades.

Beyond that, as far as I can see, the standard theme itself doesn't include the custom menus - at least when I change my local test site to display in standard theme the custom menu does not display. In which case, the relevant css would depend on where you have got the code for the menus from. As the code you have tried hasn't worked, try using firefox and firebug to find the correct css element to modify (or add if it is being picked up from a parent theme)

Richard

In reply to Richard Oelmann

Re: Changing colour of submenu highlight... Moodle 2.0

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

@Richard,

CustomMenu is in Standard theme Richard! smile It's not in Base theme though, which is Standard's parent theme.

@Miriam

You can gain a lot of information about the custom menu by reading the CSS in Moodle/lib/yui folder.

The blue hover is in some cases a sprite.png

Also check out  Development:Themes_2.0_extending_the_custom_menu

To see changes such as those made in CSS files in Moodle 2.0 you first need to enable Designer Mode in Settings > Site Administration > Appearance > Themes > Theme setting (2nd box from top of page)

Mary

In reply to Mary Evans

Re: Changing colour of submenu highlight... Moodle 2.0

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

oops clown

Wonder why it didn't display on my local test then - ah well, a puzzle for another time I think smile

Thanks for pointing it out for me though Mary

Richard

In reply to Richard Oelmann

Re: Changing colour of submenu highlight... Moodle 2.0

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

LOL...too many late nights! wink

But you must agree with me Richard, that the custom menu is way too complex to style. Much prefer the decaf theme menu. Simple and easier to style.

 

In reply to Mary Evans

Re: Changing colour of submenu highlight... Moodle 2.0

by Miriam Laidlaw -
Picture of Plugin developers

Thanks Mary, I will see what I can do with that information you have supplied me now.

I have had theme designer mode on the whole time. No good trying to design themes without it enabled when Moodle caches everything so well. big grin

@Richard

I would not overwrite the Standard theme. smile I am in a very good habit with pretty much everything (from themes, documents, images) of keeping the original safe and sound and only ever messing with a copy. But also the great documentation on Moodle Themes recommends that you make a copy of the theme you wish to modify and use that.

In reply to Miriam Laidlaw

Re: Changing colour of submenu highlight... Moodle 2.0

by Muhammad Omer Saleem -

Hi Miriam & All,

I have the same problem. I am using moodle v2.0.3+. I tried alot to get rid of this blue color both highlight on main menu item and submenu item but not succeeded yet. Please help me out to resolve this issue becuase I have lesser time to solve it.

Any help would be greatly appreciated in advance.

Thanks,

Omer

In reply to Miriam Laidlaw

Re: Changing colour of submenu highlight... Moodle 2.0

by Danny Wahl -

here you go, I hope this helps:

https://github.com/thedannywahl/Melbourne_4_Moodle_2/blob/master/style/custommenu.css

look for the sections /* Top menu */ and /* Sub menu items */ and you'll see the background and background-color declarations respectively

here's a demo of that stylesheet:

http://moodle.iyware.com/?theme=melbourne