搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

Learn More

Assigning custom icons to Firefox toolbar bookmarks

  • 1 个回答
  • 1 人有此问题
  • 15 次查看
  • 最后回复者为 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.

所有回复 (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.