Click here to Skip to main content
15,891,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to create a user style, using the Firefox Stylish add-in, to turn all the blue in my GMail to Olive Green.

The generated DOM of the GMail page is the terrain of foreign legion demi-heroes, and definitely not even for brave mortals.

How could I formualte a selector that will get all elements with a certain background colour and change that colour?
Posted

1 solution

What's wrong with creating a custom theme the way that they provide?

Settings -> Themes -> Choose your own colours

If they had done it using the 'style' attribute, which they haven't (but other sites may have), then using this jQuery Selector[^] may be of interest.

Actually, I had a brain wave.

Using jQuery, select everything:
$('*').each(function(){
    if ($(this).css('background-color')=='blue')
        $(this).css('background-color','olive-green');
});
Note that I think the css function returns colors in RGB... but don't hold me to it! I also haven't tested it, but I don't see why it shouldn't work (famous last words!).
 
Share this answer
 
v8

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900