Make firefox only use GTK theme on browser chrome, but ignore on websites

I hope I understand your situation correctly. It seems somewhat related to High contrast theme Firefox problem and to Need to modify gnome 3 theme for browser. And my answer below is essentially that which I provided to those questions!

Close (exit) all instances of Firefox. Go to your profile folder. It is here: ~/.mozilla/firefox/randomstring.default. In there, look for a subfolder called chrome.
If it doesn't exist, create it.
To create the chrome folder you can use your file manager (or the command line with mkdir chrome).
If chrome does exist, look for a file called userContent.css. Otherwise, create an empty text file with this name in the chrome folder. Now open userContent.css with a text editor and paste in or append this code:

INPUT, TEXTAREA {color: black !important; background: #aaaaaa !important; }

Save the file (as plain text) and close the text editor. Restart Firefox. You should now have black text on a light gray background. You can use whatever color combination you prefer.

Notes: chrome and userContent.css are case-sensitive and should be spelled correctly. The settings here will take precedence over those in the OS theme and will remain the same in Firefox irrespective of which gtk theme you switch to.


For some reason I couldn't get the accepted answer to work, so I wrote a small Greasemonkey script to achieve the same effect: https://gist.github.com/einarmagnus/d741e30ad13b051d7971

// ==UserScript==
// @name        bright forms
// @namespace   einar
// @description Make all form elements default to light style to combat gtk theme
// @include     *
// @version     1
// @grant       none
// ==/UserScript==
function addDefaultCssRules(rule) {
  var styleElement = document.createElement('style');
  styleElement.type = 'text/css';
  document.head.insertBefore(styleElement, document.head.firstChild);
  styleElement.sheet.insertRule(rule, 0);
}
addDefaultCssRules('input, button, textarea, select { background-color:#fff;border-radius:5px;color:#111 }');

This worked for me.