FANDOM


 
Line 2: Line 2:
   
 
'''From Your Wiki'''
 
'''From Your Wiki'''
  +
 
You have two options when importing from your own wiki.
 
You have two options when importing from your own wiki.
 
<syntaxhighlight lang="css">
 
<syntaxhighlight lang="css">
Line 12: Line 13:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
This can decrease the time it takes for the page to load. The downside is that it makes it harder to troubleshoot issues. Regardless of which import method you use, keeping your own copy of the CSS means you take on the responsibility of maintaining it. However, this also means that you can make whatever changes you want.
 
This can decrease the time it takes for the page to load. The downside is that it makes it harder to troubleshoot issues. Regardless of which import method you use, keeping your own copy of the CSS means you take on the responsibility of maintaining it. However, this also means that you can make whatever changes you want.
  +
 
'''From Other wikis/Sites'''
 
'''From Other wikis/Sites'''
  +
 
Importing directly from the dev wiki means you don't have to take responsibility for maintaining the CSS. However, it also means you can't make any changes. If you choose to take this route, you can import the CSS like this.
 
Importing directly from the dev wiki means you don't have to take responsibility for maintaining the CSS. However, it also means you can't make any changes. If you choose to take this route, you can import the CSS like this.
 
<syntaxhighlight lang="css">
 
<syntaxhighlight lang="css">

Latest revision as of 22:59, November 7, 2019

I see now. I guess I should have been more specific. You can copy-paste like that to import the stylesheet to your wiki. However, what I meant was import the stylesheet into your site CSS (which may optionally include importing the stylesheet to your wiki). Wikia checks only a few CSS pages and applies them according to their intended purpose. Currently, the ones of relevance are MediaWiki:Wikia.css and MediaWiki:Common.css. Given FANDOM's current configuration, the two serve the same purpose so CSS can go on either one. To import CSS into your site CSS, you need to use CSS's @import rule. When doing this, you can import other stylesheets both from your own wiki and from external sites/wikis.

From Your Wiki

You have two options when importing from your own wiki.

@import url("/load.php?mode=articles&only=styles&articles=MediaWiki:CustomSlider.css");
@import url("/MediaWiki:CustomSlider.css?ctype=text/css&action=raw");

What is the difference? Using the load.php version allows you to combine multiple requests into a single request. For example:

@import url("/load.php?mode=articles&only=styles&articles=MediaWiki:CustomSlider.css|MediaWiki:ListSlider.css|MediaWiki:AnotherCSS.css|MediaWiki:YetAnotherCSS.css");

This can decrease the time it takes for the page to load. The downside is that it makes it harder to troubleshoot issues. Regardless of which import method you use, keeping your own copy of the CSS means you take on the responsibility of maintaining it. However, this also means that you can make whatever changes you want.

From Other wikis/Sites

Importing directly from the dev wiki means you don't have to take responsibility for maintaining the CSS. However, it also means you can't make any changes. If you choose to take this route, you can import the CSS like this.

@import url("/w:c:dev:MediaWiki:CustomSlider.css?ctype=text/css&action=raw");

Whichever import method you use, @import must be placed at the top of the CSS page. The only things allowed above @import are blank lines, comments, and other @import statements. If there is anything else above an @import statement, the import will not be performed.

Community content is available under CC-BY-SA unless otherwise noted.