This article is a guide on code installation around Fandom.
CSS imports on Fandom
On Fandom, the CSS
@import can efficiently import a collection of stylesheets to:
- minify them and increase performance
- look cleaner
- cache consistently
Consider the examples below.
On the left there is an example of several imports using the classic
@import rule. On the right is how you can merge them in a single command, which will minify them, thus increasing performance:
Placement of CSS
CSS imports rules must be stated at the beginning of the page, before any other rule. Otherwise they won't work. Here's an example of the correct placement:
importArticles (read more).
The importArticles statement is designed to efficiently batch import scripts:
- to speed up performance,
- make your code look cleaner,
- combine multiple HTTP requests into a single data transfer,
- and allow multiple scripts to load and execute faster
Note: In this example, pay close attention to the placement of commas and other punctuation. For people who aren't familiar with programming (and even those who are!), a common mistake when writing code is to accidentally delete, forget, or misplace critical symbols like commas or quotation marks. This can cause a syntax error that breaks the code. Carefully follow the convention shown here when using
HTML and wikitext markup on Fandom
Source mode is designed to handle complex HTML codes on an article, allowing to reduce the amount of unwanted code that is sometimes automatically added. Source mode is the best way to edit if you are using templates, or HTML tags such as
Here are some useful tips:
- When you see in the edit area of visual mode, it refers to a template, or content with code that is not supported or too complex for the visual editor to handle. In source mode you will see this content in full.
- When you see in the edit area of visual mode, it refers to a comment. In source mode, you will see this content as
- MediaWiki has a special language called wikitext to make editing easier. This language is supported in visual mode and will not break as easily as HTML.
- Some HTML tags like
<s>are supported in visual mode.
- You can also enter source mode when creating or replying to threads in a forum, or when using a message wall by clicking underneath the edit area.
- You can edit templates in source mode only.