Firefox displaying input bars as black, equations in light gray

You can override gtk theme used by Firefox:

  1. navigate to about:config
  2. create a string key widget.content.gtk-theme-override
  3. set the value to any light theme name, for example Adwaita:light
  4. restart Firefox to apply

I found this issue was caused by Firefox attempting to use certain colors from my (dark) GTK theme, but it often unexpectedly clashed with things like input boxes.

To disable this:

  1. Navigate to about:config

  2. Search for browser.display.use_system_colors

  3. Set the value to false

I've no longer noticed any poorly contrasting colors, and my context menus and similar still use my GTK theme.