适用于所有网站,但不适用于浏览器

mli*_*ner 5 css firefox stylish firefox-nightly

我想将时尚主题应用于所有inpux盒子,textareas和选择盒子,所以我写道:

@namespace url(http://www.w3.org/1999/xhtml);
textarea, input, select {
  background-color: white !important;
  color: black !important;
}
Run Code Online (Sandbox Code Playgroud)

我的理解是,这只适用于网页,但它也会影响URL栏,将其变为白色.有没有办法让它不影响URL栏?

我正在使用Firefox Nightly(版本43).

更新

如果你想让GTK3 Firefox看起来是一个黑暗的主题,最终的解决方案是一个时尚的配置:

@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url-prefix('http://'), url-prefix('https://') {
  textarea, input, select {
    background-color: white !important;
    color: black !important;
  }
}
Run Code Online (Sandbox Code Playgroud)

奇迹般有效.

myf*_*myf 5

Firefox使用XUL和HTML混合作为其chrome,因此声明默认CSS名称空间也会影响浏览器chrome中的HTML元素.您可以将您的样式包含在@-moz-document限制目标内容的块中,例如:

@-moz-document url-prefix('http://'), url-prefix('https://') { /* your code here */}
Run Code Online (Sandbox Code Playgroud)