gpt4 book ai didi

Firefox 的 userChrome.css 中的 CSS 变量不生效

转载 作者:太空宇宙 更新时间:2023-11-04 05:36:25 25 4
gpt4 key购买 nike

我在 FreeBSD 上使用 Firefox 72,并在 userChrome.css 中配置了一些样式。这很好用。例如,我可以将菜单栏中"file"菜单的标签设为红色

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
#file-menu {
color: red !important;
}

现在我听说了新奇的(似乎不再那么多了)CSS 变量,又名 CSS 属性 --*,并尝试使用它们。 las,我一定是遗漏了什么,因为:

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
:root {
--foo: red;
}
#file-menu {
color: var(--foo) !important;
}

将"file"保留为默认颜色,黑色。这应该工作吗?我错过了什么吗?经过一些搜索,我发现在 about:config 中,toolkit.legacyUserProfileCustomizations.stylesheets 的值应该是 true,确实如此。现在我没主意了。

最佳答案

问题出在 @namespace 行。删除它后,CSS 变量起作用。

关于Firefox 的 userChrome.css 中的 CSS 变量不生效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59604819/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com