Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

How do you apply custom userChrome.css styles to the default tooltip created from the XUL tooltiptext attribute?

  • 3 replies
  • 1 has this problem
  • 5 views
  • Last reply by Erick

more options

Hi,

I'm trying to customize the fonts in firefox to better match the system fonts, with an eye towards fixing HiDPI font sizes.

Here is my userChrome.css:

<<START

   @namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
   /** for some reason this doesn't apply to dynamically generated `tooltiptext` tooltips */
   xul|* {
       font-size: 0.5rem;
   }

END>>

It works great, except for any tooltip created w/ the XUL tooltiptext element. I've tried, "!important", explicit includes for "xul|tooltip[default=true]", and many other fixes, none seem to work. If I inspect the XUL, firefox seems to be applying the tooltip CSS styles from chrome://global/skin/popup.css over any style rule I write.

Attatched screenshot of the oversized tootltip text from the default tooltip, notice the size of the font vs the rest of the UI.

Any way to fix this?

Hi, I'm trying to customize the fonts in firefox to better match the system fonts, with an eye towards fixing HiDPI font sizes. Here is my userChrome.css: <<START @namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /** for some reason this doesn't apply to dynamically generated `tooltiptext` tooltips */ xul|* { font-size: 0.5rem; } END>> It works great, except for any tooltip created w/ the XUL tooltiptext element. I've tried, "!important", explicit includes for "xul|tooltip[default=true]", and many other fixes, none seem to work. If I inspect the XUL, firefox seems to be applying the tooltip CSS styles from chrome://global/skin/popup.css over any style rule I write. Attatched screenshot of the oversized tootltip text from the default tooltip, notice the size of the font vs the rest of the UI. Any way to fix this?
Attached screenshots

Modified by Erick

All Replies (3)

more options

Another contributor may be better to ask however I did find in the XUL research that there is a sizeTo that specifies the height and width of a tooltip in the Firefox interface:

However there is also the add on called Stylish that gives access to a bunch of user styles for Firefox at userstyles.org, one of which offers the customization of tool tip font sizes: https://userstyles.org/styles/8558/custom-tooltips-background-color-fon...

more options

You can try to add -moz-appearance: none!important; if style rules aren't working. You will probably have to add extra rules to style the tooltip.

more options

cor-el said

-moz-appearance: none!important;

I tried that, it only applies to non-default tooltips. It doesn't style the default tooltip.