Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Este site irá ter funcionalidade limitada enquanto fazemos manutenção para melhorar a sua experiência. Se um artigo não resolve o seu problema e quiser colocar uma questão, temos a nossa comunidade de apoio à espera de o ajudar em @FirefoxSupport no Twitter, /r/firefox no Reddit.

Pesquisar no apoio

Evite burlas no apoio. Nunca iremos solicitar que telefone ou envie uma mensagem de texto para um número de telefone ou que partilhe informações pessoais. Por favor, reporte atividades suspeitas utilizando a opção "Reportar abuso".

Saber mais

[2022] Any way to change the color of individual Bookmark folders in the sidebar?

  • 5 respostas
  • 1 tem este problema
  • 1 visualização
  • Última resposta por gaveitatry

more options

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

PlacesToolbarItems > .bookmark-item[container][label="Complete Tasks" i] {fill: #FF0000 !important;} PlacesToolbarItems > .bookmark-item[container][label="Medical Coding" i] {fill: #FF0000 !important;} PlacesToolbarItems > .bookmark-item[container][label="Bodybuilding" i] {fill: #FF0000 !important;}

This isn't that important, but I was just experimenting to see if changing a few folder colors would be of any benefit to me. And the above code that I tried didn't work. I'm guessing that something changed with Mozilla Firefox in the last 1-1.5 years, and I have a feeling that if I dig into https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors for hours or even days I won't be able to figure out what I need to change. Anyone know what the new code should be? Thanks in advance.

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); PlacesToolbarItems > .bookmark-item[container][label="Complete Tasks" i] {fill: #FF0000 !important;} PlacesToolbarItems > .bookmark-item[container][label="Medical Coding" i] {fill: #FF0000 !important;} PlacesToolbarItems > .bookmark-item[container][label="Bodybuilding" i] {fill: #FF0000 !important;} This isn't that important, but I was just experimenting to see if changing a few folder colors would be of any benefit to me. And the above code that I tried didn't work. I'm guessing that something changed with Mozilla Firefox in the last 1-1.5 years, and I have a feeling that if I dig into https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors for hours or even days I won't be able to figure out what I need to change. Anyone know what the new code should be? Thanks in advance.

Modificado por gaveitatry a

Solução escolhida

The code you posted has a missing leading '#" to indicate that #PlacesToolbarItems is an 'id' and this works for folders on the Bookmarks Toolbar. Treechildren are used in the Library and in the sidebar and need other code, but for treechildren this is all or nothing (i.e. you can't color a specific folder).

Ler esta resposta no contexto 👍 0

Todas as respostas (5)

more options

From what I have seen, you now have to refer to a particular image. I am using this: https://www.userchrome.org/what-is-userchrome-css.html#colorbookmarkfolder

more options

Fill only works for SVG images. You can try background-color to see if that works better.

#PlacesToolbarItems > .bookmark-item[container][label="Complete Tasks" i] {background-color: #FF0000 !important;}
#PlacesToolbarItems > .bookmark-item[container][label="Medical Coding" i] {background-color: #FF0000 !important;}
#PlacesToolbarItems > .bookmark-item[container][label="Bodybuilding" i]   {background-color: #FF0000 !important;}

(note that that 'i' flag means ignore case, so all lowercase should work as well)

more options

Thanks. I'm not sure why, but it's not working. I had previously tried color: and background-color:. The reason why I thought I should be using fill: is because this old code I have seems to work on changing the folder icon color:

treechildren::-moz-tree-image(container) {fill:#FF0000 !important;}

I even tried deleting all of my userChrome and starting over and then adding the code you suggested, but no luck.

I will just consider this unsolved and I will leave it open in case someone finds a solution. It's not a big deal though. Thank you for your time and have a nice day.

more options

Solução escolhida

The code you posted has a missing leading '#" to indicate that #PlacesToolbarItems is an 'id' and this works for folders on the Bookmarks Toolbar. Treechildren are used in the Library and in the sidebar and need other code, but for treechildren this is all or nothing (i.e. you can't color a specific folder).

more options

Yeah, cor-el, thank you. You are right. I was missing the #. I was trying to figure out how to post the code in code format, and I tried different things and ended up deleting the #'s by accident. Another thing that you are right about, that I hadn't realized, was that I was trying to change the bookmark folder icons for the sidebar, but the code we were discussing was for the bookmarks toolbar. No wonder it wasn't working! And thanks for explaining that the sidebar will only let you change all of the folders and not each specific one.

Thanks TNorth, for the reply. I think that just shows the different things you can do to the bookmarks sidebar folder icons, but I'm thinking now that you can only change all of them at once and not individual folders. Anyway, thank you, and good night.