-
Notifications
You must be signed in to change notification settings - Fork 8
Preventing global styles
Global styles are styles that will be applied to all sites the user visits. Some style authors will accidentally post global styles to userstyles.org when they intend to post styles that are more specific. This page will describe how to prevent this from occurring.
If you create your style in Stylem, you can use @-moz-document rules to specify what domain your style is active on. For example, to make your code apply only to pages on the domain "example.com", you would use the following code:
@-moz-document domain(example.com) {
/* your code goes here */
}Ensure your code is followed by the closing bracket for the @-moz-document block, as shown above.
For more detailed usage of @-moz-document rules, see Applying styles to specific sites.
XUL-based applications such as Pale Moon and Basilisk have the ability to apply styles to their own user interface: toolbars, dialogs, tabs, etc. If you intend to have your style do this, include this line at the top of your code:
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);This says that the default namespace of your style is XUL. XUL is the language Pale Moon and Basilisk's user interface is written in; defining it as the default makes your style specific to XUL and lets userstyles.org understand what you intend.