Search code examples
cssstylish

Specify urls not to affect wih @-moz-document in stylish


With stylish you can specify a domains using @-moz-document url-prefix(http://) for example.

This applies to all URLs. Is there a way to specify which URLs you don't want the style to affect? This means you could have a global stylesheet that effects everything except specified URLs where there is another stylesheet you want to use.


Solution

  • This can get tricky but it can be done.
    From the the Stylish documentation: "Applying styles to specific sites":

    @-moz-document regexp('(?!http://www\.example\.com).*') {
        /* CSS rules here.*/
    }
    

    Will activate for all URLs except those that start with http://www.example.com.