this post was submitted on 14 Nov 2024
5 points (100.0% liked)

Firefox Customs

64 readers
6 users here now

Chat with us!

Post your unsupported Firefox customizations here!

From the makers of r/FirefoxCSS

Links

Related

Rules

  1. Posts must have flair!
  2. Posts cannot be memes/shitposts. They should be about Firefox customization with CSS.
  3. Please be civil. Bear in mind that many users come here for help and would be turned off by insults and rudeness.
  4. When posting large amount of code use a service dedicated to hosting text snippets, such as pastebin, hastebin, github gist or equivalent. Relatively short snippets can be wrapped in code-block for inline viewing.
  5. Do NOT use url-shorteners or link to compressed downloads (such as zip or rar) when sharing code.

founded 2 years ago
MODERATORS
 

I have created a standard hover background which, using various stanzas, applies to everything except the toolbar bookmark items and buttons. The following code doesn't have the desired effect on bookmarks. What will? The browser toolbox only shows the main window so I have improvised.

toolbarbutton.bookmark-item(hover) { background-color: #6495ed !important; }

I can't think what to use for toolbar buttons such as UBlock Origin.

you are viewing a single comment's thread
view the rest of the comments
[–] MrOtherGuy 1 points 1 month ago (1 children)

In that case the code you posted should work, provided that you fix the hover syntax:

toolbarbutton.bookmark-item:hover { background-color: #6495ed !important; }
[–] [email protected] 1 points 1 month ago (1 children)

Thanks. What about the toolbar buttons?

[–] MrOtherGuy 1 points 1 month ago (1 children)

You could do this:

toolbar .toolbarbutton-1:not([disabled]):hover > :is(.toolbarbutton-icon, .toolbarbutton-text, .toolbarbutton-badge-stack){
  background-color: #6495ed !important;
}

But if you want to just change the background-color of all the elements where that same color gets used (so buttons, bookmark-items, tabs scrollbuttons, sidebar switcher button etc.) then it would be much easier to redefine the value for the variable they all use:

:root{
  --toolbarbutton-hover-background: #6495ed !important;
}
[–] [email protected] 1 points 1 month ago (1 children)

Thanks again. That does not have the desired result on my browser. The following code changes the hover colour of all toolbar buttons including bookmark items.

toolbarbutton:hover { background-color: #6495ed !important; }

[–] MrOtherGuy 1 points 1 month ago (1 children)

I mean, if that works for you the go for it, but that isn't quite the same thing. For you normal buttons in the toolbar, the hover background-color is not on the <toolbarbutton> itself, but on the icon inside the button. The area of the icon is smaller than the button, so what happens is that you will be shown both colors which should be pretty visible especially if the theme you have uses some drastically different color. In addition, that will also apply to buttons inside panel menus, which may or may not be what you wanted.

[–] [email protected] 1 points 1 month ago

Thanks again. I added the first code below to an existing :root stanza and it is effective. If I add the second code, I get the default colour as well, as you say. I hadn't noticed that until I changed the hover colour to a lighter blue.

I do want the colour to apply to menus inside panel menus. Bookmark menus have the set hover colour.

--toolbarbutton-hover-background: #83b7fb !important;

toolbarbutton:hover { background-color: #83b7fb !important; }