2

How do I prevent the themes that I've installed into Ubuntu from affecting how Firefox looks? Changing the way the window looks is okay, but it's changing the way my tabs, menus and text box areas are looking.

1
  • "Destroying"? How about "changing the appearance of"? – CarlF Oct 17 '09 at 1:38
5

I'm afraid that isn't possible unless there was a feature implemented specifically to do this, since Firefox uses native widgets. For example, an OK button on a dialog will look the same as an OK button in Firefox options. The goal is to make a general look and feel applied for all native apps. You can use themes though to change Firefox's look a little more to your liking.

1
  • Actually there is a way, at least now: unix.stackexchange.com/a/185115 As I mentioned in my answer, clashes between the user's environment, the application, the user's profile in that application, and finally the web developer's stylesheets are basically inevitable. In my case every radio button and check box was invisible and I was stuck with constantly tweaking a global stylesheet with lots of !importants to fix all the edge cases until I found this solution. – John P Jul 28 '17 at 20:35
1

There is a way! I'm so happy to have found this - my GTK theme works great for menus and most applications, but makes color choosers in Tilda and many input types in Firefox (check boxes, radio buttons, some textareas, etc.) invisible, I'm guessing because of incorrect assumptions on both parties about how style inheritance should work. My apologies if you aren't actually talking about GTK themes, I don't know much about others.

Anyway, you can set the GTK_THEME variable as a prefix to graphical applications, from the terminal, desktop entry, or launcher. In testing, Thunar did not honor the theme, but Gedit and Firefox did.

Run from the terminal:

GTK_THEME=<theme> <application>

Modify desktop launchers:

Exec=env GTK_THEME=<theme> <application> %U

See https://unix.stackexchange.com/a/185115.

Of course you can still apply Firefox themes - in fact you will get much more reliable results, since you're free to tamper with your environment and Firefox themes independently. This also means you can validate an application's theme/skin with different native themes (even in batches!) without changing your own configuration. To that end I would recommend creating a new Firefox profile with just a browser theme installed to test it.

There are some caveats; first, many applications have a thin wrapper that checks environment variables to prepare the invocation of the core program, and if they miss this variable, inadvertently clobber it, or deliberately override it, all bets are off. Second, the graphical application with or without a wrapper must also be willing and able to read these settings. For QT I have found the following:

QApplication::setDesktopSettingsAware

Sets whether Qt should use the system's standard colors, fonts, etc., to on. By default, this is true.

http://pyqt.sourceforge.net/Docs/PyQt4/qapplication.html#setDesktopSettingsAware

So toolkits may provide interfaces for inheriting themes in general, but there's almost always a way around it. For comparison, what if you want to use GTK for native elements in QT? Apparently there are several red herring methods and a lesser-known method that doesn't work for everyone.

https://stackoverflow.com/questions/40455844/make-qt-application-use-gtk-theme

My UI nightmare with Firefox is over, and hopefully yours is too. If you have issues like this in the future, try testing in a chroot, VM, or new user profile to see what variables are at play. That's about the best I can offer.

0

You can edit the default profiles userContent.css:

 ~/.mozilla/firefox/abc123abc.default/chrome/userContent.css

For example if using a dark theme and an text is unreadable:

userContent.css:

input {
   border: 2px inset white;
   background-color: white;
   color: black;
   -moz-appearance: none !important;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.