Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

css

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.

like image 852
fergusdawson Avatar asked Oct 15 '12 22:10

fergusdawson


People also ask

What is moz document URL prefix ()?

The url-prefix rule applies the contained style rules to any page whose URL starts with it. When used with no URL argument like @-moz-document url-prefix() it applies to ALL pages. That's effectively a CSS hack used to only target Gecko (Mozilla Firefox). All other browsers will ignore the styles.

What is a document in CSS?

Cascading Style Sheets (CSS) is a stylesheet language used to describe the presentation of a document written in HTML or XML (including XML dialects such as SVG, MathML or XHTML). CSS describes how elements should be rendered on screen, on paper, in speech, or on other media.


1 Answers

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.

like image 65
Brock Adams Avatar answered Nov 15 '22 05:11

Brock Adams