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!

为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

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

详细了解

Reduce buffer between Bookmark Toolbar icons?

  • 3 个回答
  • 1 人有此问题
  • 14 次查看
  • 最后回复者为 cor-el

more options

I just updated from a much older version of Firefox, and now fewer bookmark icons fit in my bookmarks toolbar. I'm hoping there's a way in about:config that I can reduce the buffer space between Bookmarks Toolbar icons.

(Yes, I already deleted the names on the bookmarks in my toolbar, I'm way past that for many years now.)

Would really appreciate some quick pointers on this, since it's dumped 18 icons into the expansion area....

I just updated from a much older version of Firefox, and now fewer bookmark icons fit in my bookmarks toolbar. I'm hoping there's a way in about:config that I can reduce the buffer space between Bookmarks Toolbar icons. (Yes, I already deleted the names on the bookmarks in my toolbar, I'm way past that for many years now.) Would really appreciate some quick pointers on this, since it's dumped 18 icons into the expansion area....

所有回复 (3)

more options

Hi Josslyn81, unfortunately there is no built-in setting for toolbar button spacing, you would need to create a userChrome.css file and add a rule that tweaks the margins.

Actually, there are many possible adjustments you can make, such as shortening the space for text labels (or hiding them), moving the icons closer to the text, etc.

Here's a rough idea of the spacing "out of the box" which you might consider adjusting:

Let's say you want to cut those 4 pixel gaps down to 2 pixels. A custom style rule for that might be:

#PlacesToolbar toolbarbutton {
  padding-left: 2px !important;
  padding-right: 2px !important;
}
#PlacesToolbar toolbarbutton .toolbarbutton-icon {
  margin-right: 2px !important;
}

Then to apply that to your Firefox, when you have 10 minutes to dive into it, this is how you set it up:

This assumes you do not already have a userChrome.css file. If you do already have a working userChrome.css file, you just need to add the above rule to your file.

(A) Select and copy the above style rule code

(B) Generate and download a userChrome.css file

Open the following page and paste the above rules into the editor, replacing the sample rule:

https://www.userchrome.org/download-userchrome-css.html

Then click "Generate CSS File" and save the userChrome.css file to your computer. (See first attached screenshot)

Use the downloads list on the toolbar to open the downloads folder directly to the new userChrome.css file. (See second attached screenshot)

Minimize that Windows Explorer window for later reference.

(C) Create a new chrome folder in your profile folder

The following article has the detailed steps for that (#1, #2, and I recommend #3)

https://www.userchrome.org/how-create-userchrome-css.html

There are boring videos for Windows and Mac if you like videos.

(D) Move the userChrome.css file you generated in Step B into the chrome folder you created in Step C

The next time you exit Firefox and start it up again, it should discover that file and apply the rules.

Success?

more options

Now that I re-read your question:

Since you removed the text labels, you don't need any right margin after the icon to separate it from the text. So the second part can be revised down to zero:

/* Space between button boundary and content*/
#PlacesToolbar toolbarbutton {
  padding-left: 2px !important;
  padding-right: 2px !important;
}
/* Spacing after icon, before text */
#PlacesToolbar toolbarbutton .toolbarbutton-icon {
  margin-right: 0px !important;
}
more options

Note that you can hide the text labels easily via userChrome.css, so if you have use userChrome.css then you can add such a rule and no longer need to edit the name.

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

/* hide bookmark label, leave folder label */
#personal-bookmarks .bookmark-item:not([container=true]) .toolbarbutton-text {
 display:none!important;
}