Die Funktionalität dieser Website ist durch Wartungsarbeiten eingeschränkt, die Ihr Erlebnis verbessern sollen. Wenn ein Artikel Ihr Problem nicht löst und Sie eine Frage stellen möchten, können Sie unsere Gemeinschaft über @FirefoxSupport auf Twitter, /r/firefox oder Reddit fragen.

Hilfe durchsuchen

Vorsicht vor Support-Betrug: Wir fordern Sie niemals auf, eine Telefonnummer anzurufen, eine SMS an eine Telefonnummer zu senden oder persönliche Daten preiszugeben. Bitte melden Sie verdächtige Aktivitäten über die Funktion „Missbrauch melden“.

Weitere Informationen

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

  • 3 Antworten
  • 1 hat dieses Problem
  • 5 Aufrufe
  • Letzte Antwort von 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?
Angefügte Screenshots

Geändert am von Erick

Alle Antworten (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.