Mozilla VPN is currently experiencing an outage. Our team is actively working to resolve the issue. Please check the status page for real-time updates. Thank you for your patience.

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

Assigning custom icons to Firefox toolbar bookmarks

  • 1 resposta
  • 1 tem este problema
  • 28 visualizações
  • Última resposta por Paul

more options

I'm running the latest version of Firefox on Xubuntu 20.04.

Thanks to some help from others long ago, I've been assigning custom icons to my toolbar bookmarks for quite some time. This is done in the appropriate profile directory (~/.mozilla/firefox/<profile>/chrome) by placing a 16x16 pixel PNG icon in an icons sub-directory, and then creating entries in the userChrome.css file. Here is an example:

.bookmark-item[label="Google"] image {

   margin: 0px !important;
   padding: 0 0 16px 16px !important;
   background:url("icons/google_01.png") !important;

}

.bookmark-item > .toolbarbutton-text { display: none !important; }

The first entry assigns my custom icon "google_01.png" to a bookmark with the text label "Google". The second entry makes sure that the text labels are not displayed on the toolbar.

This works great for bookmarks on the toolbar. I decided to create various folders and consolidate groups of bookmarks. I created a google folder with the label "Google" and it gets the custom icon I have assigned. However, the various bookmarks placed within the folder (Maps, Gmail, Calendar, Contacts, Drive, Groups, Search), each with unique userChrome.css entries of their own, and which displayed as desired when on the toolbar, often lose their custom icon when placed in the folder, getting the icon assigned to the folder itself repeated for these entries -- but not always! For example, given:

.bookmark-item[label="Maps"] image {

   margin: 0px !important;
   padding: 0 0 16px 16px !important;
   background:url("icons/maps_01.png") !important;

}

.bookmark-item[label="Gmail"] image {

   margin: 0px !important;
   padding: 0 0 16px 16px !important;
   background:url("icons/gmail_01.png") !important;

}

.bookmark-item[label="Contacts"] image {

   margin: 0px !important;
   padding: 0 0 16px 16px !important;
   background:url("icons/contacts_01.png") !important;

}

.bookmark-item[label="Drive"] image {

   margin: 0px !important;
   padding: 0 0 16px 16px !important;
   background:url("icons/drive_01.png") !important;

}

.bookmark-item[label="Groups"] image {

   margin: 0px !important;
   padding: 0 0 16px 16px !important;
   background:url("icons/groups_01.png") !important;

}

The Maps and Groups bookmarks get the desired icon displayed, but the remainder just get the google_01.png icon assigned to the folder. This kind of random working/not working repeats for every other folder I create.

So I'm wondering if anyone has a clue as to what's going on and how I might better rewrite the bookmark-item entries to get the icons to reliable display when located in toolbar folders.

Thanks.

I'm running the latest version of Firefox on Xubuntu 20.04. Thanks to some help from others long ago, I've been assigning custom icons to my toolbar bookmarks for quite some time. This is done in the appropriate profile directory (~/.mozilla/firefox/<profile>/chrome) by placing a 16x16 pixel PNG icon in an icons sub-directory, and then creating entries in the userChrome.css file. Here is an example: '''.bookmark-item[label="Google"] image { margin: 0px !important; padding: 0 0 16px 16px !important; background:url("icons/google_01.png") !important; }''' '''.bookmark-item > .toolbarbutton-text { display: none !important; }''' The first entry assigns my custom icon "google_01.png" to a bookmark with the text label "Google". The second entry makes sure that the text labels are not displayed on the toolbar. This works great for bookmarks on the toolbar. I decided to create various folders and consolidate groups of bookmarks. I created a google folder with the label "Google" and it gets the custom icon I have assigned. However, the various bookmarks placed within the folder (Maps, Gmail, Calendar, Contacts, Drive, Groups, Search), each with unique userChrome.css entries of their own, and which displayed as desired when on the toolbar, often lose their custom icon when placed in the folder, getting the icon assigned to the folder itself repeated for these entries -- but not always! For example, given: '''.bookmark-item[label="Maps"] image { margin: 0px !important; padding: 0 0 16px 16px !important; background:url("icons/maps_01.png") !important; }''' '''.bookmark-item[label="Gmail"] image { margin: 0px !important; padding: 0 0 16px 16px !important; background:url("icons/gmail_01.png") !important; }''' '''.bookmark-item[label="Contacts"] image { margin: 0px !important; padding: 0 0 16px 16px !important; background:url("icons/contacts_01.png") !important; }''' '''.bookmark-item[label="Drive"] image { margin: 0px !important; padding: 0 0 16px 16px !important; background:url("icons/drive_01.png") !important; }''' '''.bookmark-item[label="Groups"] image { margin: 0px !important; padding: 0 0 16px 16px !important; background:url("icons/groups_01.png") !important; }''' The Maps and Groups bookmarks get the desired icon displayed, but the remainder just get the google_01.png icon assigned to the folder. This kind of random working/not working repeats for every other folder I create. So I'm wondering if anyone has a clue as to what's going on and how I might better rewrite the bookmark-item entries to get the icons to reliable display when located in toolbar folders. Thanks.

Todas as respostas (1)

more options

WARNING from the moderator team: userChrome.css scripts are not provided by Mozilla and are not officially supported. Firefox is a work in progress and, to allow for continuous innovation, Mozilla cannot guarantee future updates won’t impact your customizations. For this reason, Mozilla does not officially support style rules customization.

Please read Firefox Advanced Customization and Configuration Options to learn more.