Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apply Stylish to all websites but NOT browser

I want to apply a Stylish theme to all inpux boxes, textareas and select boxes, so I wrote:

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

My understanding is that that will only apply to Web pages, but it's also affecting the URL bar, turning it white. Is there a way to make it not affect the URL bar?

I'm using Firefox Nightly (version 43).

Update

If you want GTK3 Firefox to look right with a dark theme, the final solution is a stylish config with:

@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;
  }
}

Works like a charm.

like image 751
mlissner Avatar asked Oct 14 '15 16:10

mlissner


1 Answers

Firefox uses mix of XUL and HTML for its chrome, so declaring default CSS namespace affects HTML elements from browser chrome as well. You can wrap your style in @-moz-document block restricting origin of target content, like:

@-moz-document url-prefix('http://'), url-prefix('https://') { /* your code here */}
like image 150
myf Avatar answered Nov 19 '22 18:11

myf