需要为浏览器修改gnome 3主题

我最近开始在Gnome 3中使用DarkGreen主题,但FireFox中有关文本输入字段的某些网页存在一些问题。 这种情况发生在谷歌的搜索领域,Facebook上的某些领域等……

此主题通过defaut使用深色背景和浅色文本作为输入字段。 我已成功地为那些从未受影响的字段(从近白色到灰色)成功修改输入文本的前景色,但它对“破损”字段没有帮助。 我还想将所有输入字段的背景颜色更改为白色,但我也没有运气。

在主题文件夹中有一个带有css文件的gtk文件夹。 以下是相关内容,评论是我改变的:

@define-color theme_base_color #202020; @define-color theme_text_color #25DC00; /* #ffffff */ @define-color theme_bg_color #121212; @define-color theme_fg_color @theme_text_color; @define-color selected_bg_color #3E8753; @define-color selected_fg_color #ffffff; @define-color theme_selected_bg_color @selected_bg_color; @define-color menu_bg_color #555555; @define-color menu_fg_color @theme_text_color; @define-color menu_combobox_border @theme_selected_bg_color; @define-color menu_separator mix (@theme_bg_color, @menu_bg_color, 0.90); @define-color insensitive_bg_color alpha(#0b0b0d, 0.0); @define-color insensitive_fg_color alpha(#717171, 0.50); @define-color insensitive_border_color alpha(#717171, 0.50); @define-color entry_text_color /* #fafafa */ #707070; @define-color entry_background_a #ffffff; @define-color entry_background_b #ffffff; @define-color entry_background_c #ffffff; @define-color entry_background_d #ffffff; /* 121212 */ @define-color frame_color #707070; 

这个CSS文件是我唯一需要改变的吗?

我建议使用一种特定于Firefox的不同方式来实现您想要的效果。

关闭(退出)Firefox的所有实例。
转到您的个人资料文件夹。 它在这里: /home/your_name/.mozilla/firefox/randomstring.default
在那里,寻找一个名为chrome的子文件夹。 如果它不存在,请创建它。
如果chrome确实存在,请查找名为userContent.css的文件。 否则,在chrome文件夹中创建一个具有此名称的空文件。
现在用文本编辑器打开userContent.css并粘贴以下代码:
INPUT, TEXTAREA {color: black !important; background: #aaaaaa !important; }

保存文件(作为纯文本)并关闭文本编辑器。
重启Firefox。
您现在应该在浅灰色背景上有黑色文本。 您可以使用您喜欢的任何颜色组合。

注意: chromeuserContent.css区分大小写,应拼写正确。
此处的设置将优先于操作系统主题中的设置,并且在Firefox中将保持不变,无论您切换到哪个gtk主题。

(顺便说一句,您可能对Stylish扩展以及用户创建并在userstyles.org上托管的各种样式感兴趣。)

编辑:
我提供了一些与希望Firefox 不受 OS(gtk)主题影响的用户相关的链接。 请注意,我尚未检查建议的解决方案是否仍然有效 。 这些链接更多的是背景:
如何让firefox完全忽略我的GTK主题?
错误70315 – 如果使用深色GTK主题(对于Seamonkey),菜单和框中的文本无法读取
有什么方法可以防止Firefox使用操作系统本机颜色?

我在ArchLinux Wiki上找到了以下内容,可以直接应用于此处的问题。 我发现结果比用户25656更好。

方法是相同的:您使用以下内容创建/home//.mozilla/firefox/.default/chrome/userConent.css

 input:not(.urlbar-input):not(.textbox-input):not(.form-control):not([type='checkbox']) { -moz-appearance: none !important; background-color: white; color: black; } #downloads-indicator-counter { color: white; } textarea { -moz-appearance: none !important; background-color: white; color: black; } select { -moz-appearance: none !important; background-color: white; color: black; } 

(由于声誉不佳,我无法发表评论,这就是为什么这是一个新的答案。)

我遵循了dd23的建议,它主要起作用,尽管只有受影响页面上一半混乱的元素。 我找到了一个看起来效果更好的CSS。

顺便说一下,您还可以使用Stylish Firefox Add-On来应用此CSS。

 /* * Use this css file to eliminate problems in Firefox * when using dark themes that create dark on dark * input boxes, selection menus and buttons. Put this * in the ../firefox/default/chrome folder or your * individual user firefox profile chrome folder. */ input { border: 2px inset white; background-color: white; color: black; -moz-appearance: none !important; } textarea { border: 2px inset white; background-color: white; color: black; -moz-appearance: none !important; } select { border: 2px inset white; background-color: white; color: black; -moz-appearance: none !important; } input[type="radio"], input[type="checkbox"] { border: 2px inset white ! important; background-color: white ! important; color: ThreeDFace ! important; -moz-appearance: none !important; } *|*::-moz-radio { background-color: white; -moz-appearance: none !important; } button, input[type="reset"], input[type="button"], input[type="submit"] { border: 2px outset white; background-color: #eeeeee; color: black; -moz-appearance: none !important; } body { background-color: white; color: black; display: block; margin: 8px; -moz-appearance: none !important; } 

来自Fedora论坛的PabloTwo解决方案。 关于Mozilla错误报告的评论15中也提到了这一点。 是的,这是一个已知的错误。