如何使 Firefox 看起来更像当前的 GTK 主题?

如何使 Firefox 看起来更像当前的 GTK 主题?

据我所知,这一直是 Mozilla Firefox 和 Thunderbird 的问题。它们总是有一些与当前主题不一致的元素,用户可以通过创建和/或修改“... /<profile_dir>/chrome/userChrome.css”来修复。

例如,我添加以下块(根据 GTK 当前主题更改颜色值)以使 Thunderbir 侧边栏看起来像其他侧边栏:

#folderTree > treechildren::-moz-tree-row(even) {
    border: 1px solid transparent !important;
    background-color: #eff0f1 !important;
}

#folderTree > treechildren::-moz-tree-row(odd) {
    border: 1px solid transparent !important;
    background-color: #eff0f1 !important;
}

#folderTree > treechildren::-moz-tree-row(selected) {
    border: 1px solid transparent !important;
    background-color: #3daee9 !important;
    color: #ffffff !important;
}

#folderTree > treechildren::-moz-tree-row(hover) {
border: 1px solid transparent !important;
background-color: #3daee9 !important;
}

#folderTree > treechildren::-moz-tree-line {
visibility: visible !important;
}

但是,我需要一点帮助来更改菜单和工具栏(Firefox 和 Thunderbird)中的悬停背景颜色,如下面的屏幕截图所示。

在此处输入图片描述

Firefox 内置菜单(以及菜单按钮,与其他工具栏和书签栏按钮相同)中看到的浅灰色悬停背景颜色实际上应该是浅蓝色(如地址栏的边框颜色)。

我该如何实现这个?

答案1

更新:请注意行为在 Firefox 89 中已发生改变。 其他Firefox 90 中发生了变化以及。从 Firefox 90 开始,我们可以使用widget.non-native-theme.gtk.scrollbar.*中的设置about:config来修改滚动条的外观。

原始答案
就我而言,Firefox ESR 78 忽略了系统 GTK3 主题设置~/.config/gtk-3.0/gtk.css以及返回的内容:

gsettings get org.gnome.desktop.interface gtk-theme

最明显的是,长页面上的垂直滚动条具有默认的 GTK3 Adwauta 主题外观。其他 GTK3 应用使用正确的主题,不会出现此问题。

解决方法是使用以下命令行启动 Firefox:

GTK_THEME=My firefox-esr`

或者为了使其永久存在,您可以将以下石灰添加到您的~/.profile

export GTK_THEME=<Your theme name like Adwaita:dark>

相关内容