Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

Sidebar line spacing - Simple Tab Groups add-on

  • 7 trả lời
  • 1 gặp vấn đề này
  • 77 lượt xem
  • Trả lời mới nhất được viết bởi moz_spt

more options

Hi How can I write code to change line spacing for the sidebar of the add-on "Simple Tab Groups".


I found this code which changes line spacing for Bookmarks ... it works. https://support.mozilla.org/si/questions/1238370

@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul); /* Minimize height of sidebar items */ .sidebar-placesTreechildren::-moz-tree-row {

   min-height: 18px !important;
   height: 18px !important;
   max-height: 18px !important;

}

Giải pháp được chọn

I installed the extension and added a couple tabs. You want to reduce/override the height and min-height?

Turns out the rules need to go into a userContent.css file. For example,

#stg-popup .item {
  min-height: 18px !important;
  height: auto !important;
}


Yielding this:

Or course, adjust that min-height and height as desired.

Đọc câu trả lời này trong ngữ cảnh 👍 1

Tất cả các câu trả lời (7)

more options

Most likely an add-on's sidebars do not use the messy "tree" code of ancient XUL but instead use standard HTML elements.

If you want to "Inspect" an add-on sidebar, try this:

  • Open the add-on's sidebar
  • Type or paste about:debugging in the address bar and press Enter to load that page
  • In the left column, click This Firefox
  • Find the extension and click its Inspect button -- this should open a new tab
  • Switch to the Inspector panel if needed, then look in the right side for a selector that lets you choose what to inspect -- it looks like a window with a sidebar and a main area -- choose the sidebar page here (this might or might not be obvious from the available file names)
  • Now you should have a familiar inspector view into the sidebar to identify elements and style rules

Now, whether your overriding styles belong in a userChrome.css or userContent.css file, I don't know...

Hữu ích?

more options

Thanks, this is very informative. It looks like there is code to control appearance (see attachment).

The CSS in the "Style Editor" tab makes changes when manually edited. But I haven't found the setting which controls spacing.

If I do make changes manually to the CSS in the "Style Editor" tab, will they be permanently applied. Is this how it works?

Edit: Sorry, I think you say you need to override by writing code to a file, and it may or may not be userChrome.css.

Được chỉnh sửa bởi moz_spt vào

Hữu ích?

more options

Giải pháp được chọn

I installed the extension and added a couple tabs. You want to reduce/override the height and min-height?

Turns out the rules need to go into a userContent.css file. For example,

#stg-popup .item {
  min-height: 18px !important;
  height: auto !important;
}


Yielding this:

Or course, adjust that min-height and height as desired.

Hữu ích?

more options

The procedure for userContent.css is nearly identical to userChrome.css -- same chrome folder, same preference to direct Firefox to look for the file at startup. Example thread:

https://support.mozilla.org/en-US/questions/1338198#answer-1456835

Hữu ích?

more options

Thank you for looking at this. I couldn't get the HTML code to show up for some reason. All I get is as per attachment. However I did create a userContent.css file with your code and this did work.

Hữu ích?

more options

I see the problem in your screenshot. You're not inspecting the sidebar. If you look to the right end of the row with Inspector Console Debugger... you'll see an icon that looks like a window with a sidebar (or a frameset). Click that button and you can choose to inspect the "popup" page which is open in the sidebar. (It only works if the sidebar is currently showing that page.) Sorry that wasn't clear enough.

Hữu ích?

more options

Great, thanks for the additional info.

Hữu ích?

Đặt một câu hỏi

Bạn phải đăng nhập vào tài khoản của bạn để trả lời bài viết. Vui lòng bắt đầu một câu hỏi mới, nếu bạn chưa có tài khoản.