Help:Advanced CSS and JS

Creating some custom code for your community, or for your own account? This page has more background details to help you with both.

For a more basic overview, see Help:CSS and JS customization.

CSS and JS cheatsheet
The tables below are summarized guides to most of CSS and JS customization pages. The most common choices are highlighted in green.

CSS and JS editor error checking
Wikia's CSS and JS editors have active error checking ("linting") and syntax highlighting:
 * As you type code, the page will let you know about any errors in the syntax that might have occurred
 * Do note that not every issue has to be be solved - CSS (and even JS) technology is ever evolving, and browsers do not all behave identically: some messages may not require action.

Advanced notes

 * Load orders
 * The general load order on Wikia is: core code, then local community code, then personal code.
 * Within each level, the load order is: 'common' code, then skin-specific code.


 * !important in CSS
 * Due to CSS load orders, you may sometimes need to make use of the !important property to ensure a CSS rule is applied.


 * Caching issues
 * Every file you download from the Internet gets cached. Normally that's great because it reduces traffic both for your own device and for Wikia's servers, but it can be a problem when it comes to testing design changes. It may take a while before your changes to take effect unless you use the following tricks:


 * You may need to manually refresh each page you recently opened to see the change there.


 * Popular JavaScript snippets
 * To get an idea of some scripts others have written that you might find useful or would like to try, take a look at the on the Developers Wiki.


 * Duplicate JavaScript
 * Many scripts can have problems if they run multiple times on the same page. Make sure write the code such that a particular piece of code runs only once. Avoid pasting the same code in multiple files as it will likely conflict and cause confusing errors for you and other visitors.