![]() That means that declarations made at the top of a page can be overridden by ones at the bottom.ĭue to CSS load orders, you may sometimes need to make use of the !important property to ensure a CSS rule is applied. Imported scripts through Fandomdesktop.jsįinally, remember the obvious: pages load from top to bottom.Because ImportJS loads last, you can put your customization of a Dev Wiki script in Common.js or Fandomdesktop.js, but have the import of the script itself in ImportJS. It also critically means that if you're importing CSS or fonts - and your wiki has both Common.css and Fandomdesktop.css - those imports need to be at the very top of Common.css.įor JS, load order is especially important when considering how to best use MediaWiki:ImportJS. And because personal CSS is last, whatever you put there always overrides the local wiki's choices. get ( 'wgPageName' )) in Fandomdesktop.css, the. In MediaWiki:Common.js, use a switch to apply JavaScript to certain pages: page-, where spaces, colons, and other special characters are replaced by underscores. For example, on this help page, the class is. The HTML element on articles includes a unique identifier based on the name of the page. If you're planning to write some JavaScript for your community, you'll need to ask for it to be turned on by contacting Fandom Support, and familiarize yourself with the JavaScript review process. 2 Applying CSS and JS to specific communitiesĬreating some custom code for your community or for your own account? This page goes a little further than our overview page to give you some helpful details.īefore you get started, though, you'll want to check out which pages can be used for customization.
0 Comments
Leave a Reply. |