FANDOM


Nuvola apps important
This script is for PERSONAL use only!
You are free to install this script for yourself, but it is not allowed to be used wiki-wide (e.g., in MediaWiki:Common.js or MediaWiki:Wikia.js), as it would violate FANDOM's Terms of Use.
(See the customization policy)

ReplaceWordmark replaces a wiki's wordmark with another custom image.

Usage

ReplaceWordmark has three configurable variables:

  • replace-wordmark-img - wordmark image
  • replace-wordmark-x - wordmark image width; maximum is 65px
  • replace-wordmark-y - wordmark image height; maximum is 250px

The installation code is below, but remember to substitute

Installation

Add this CSS on your wiki:

Personal

Special:Mypage/common.css

*Note: for wikis created before July 2014, MediaWiki:Common.css may not apply on both skins. Read more on this page.

/* ReplaceWordmark */
 
/** Wordmark variables **/
 
:root {
    --replace-wordmark-img: url('https://vignette.wikia.nocookie.net/central/images/8/89/Wiki-wordmark.png/revision/20180206165044'); /* image */
    --replace-wordmark-y: 65px; /* height - maximum is 65px */
    --replace-wordmark-x: 125px; /* width - maximum is 250px */
}
 
/** Wordmark replacement **/
 
.skin-oasis .wds-community-header__wordmark img,
.skin-oasis.editor .EditPageHeader > .wordmark img,
.ChatWindow #ChatHeader .wordmark img,
.ChatWindow #Rail .public .wordmark {
    background-image: var(--replace-wordmark-img);
    background-repeat: no-repeat;
    background-position: top left;
    box-sizing: border-box;
}
 
.skin-oasis .wds-community-header__wordmark img {
    padding-top: var(--replace-wordmark-y);
    height: var(--replace-wordmark-y);
    width: var(--replace-wordmark-x);
}
 
@media only screen and (max-width: 1083px) {
    .skin-oasis .wds-community-header__wordmark img {
        background-size: calc(0.75*var(--replace-wordmark-x)) calc(0.75*var(--replace-wordmark-y));
        height: calc(0.75*var(--replace-wordmark-wordmark-y));
        padding-top: calc(0.75*var(--replace-wordmark-y));
        width: calc(0.75*var(--replace-wordmark-x));
    }
}
 
.skin-oasis.editor .EditPageHeader > .wordmark img {
    background-size: calc(0.69*var(--replace-wordmark-x)) calc(0.69*var(--replace-wordmark-y));
    padding-top: calc(0.69*var(--replace-wordmark-y));
    height: calc(0.69*var(--replace-wordmark-y));
    width: calc(0.69*var(--replace-wordmark-x));
}
 
.ChatWindow #ChatHeader .wordmark img,
.ChatWindow #Rail .public .wordmark {
    background-size: calc(0.47*var(--replace-wordmark-x)) calc(0.47*var(--replace-wordmark-y));
    height: calc(0.47*var(--replace-wordmark-y));
    padding-top: calc(0.47*var(--replace-wordmark-y));
    width: calc(0.47*var(--replace-wordmark-x));
}
Importing CSS pages on FANDOM
There are different ways to import CSS, click on "Expand" to learn how to efficiently batch import scripts to speed up performance and make your code look cleaner.
If your CSS page has several lines of code that say @import, you may be able to combine them! By batch importing a collection of scripts with a single import, your CSS will load faster and look cleaner. 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:
Classic imports Combined imports
@import url("/index.php?title=MediaWiki:LocalCSS1.css&action=raw&ctype=text/css");
@import url("/index.php?title=MediaWiki:LocalCSS2.css&action=raw&ctype=text/css");
@import url("http://dev.wikia.com/index.php?title=MediaWiki:InterWikiCSS.css&action=raw&ctype=text/css");
@import url("/load.php?mode=articles&only=styles&articles=MediaWiki:LocalCSS1.css|MediaWiki:LocalCSS2.css|u:dev:MediaWiki:InterWikiCSS.css")

Note: 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:

Wrong placement Correct placement
/* BEGINNING OF THE PAGE */
/** other styles **/
.example { 
    styling
}
 
/** imports **/
@import url("/load.php?mode=articles&only=styles&articles=MediaWiki:LocalCSS1.css|MediaWiki:LocalCSS2.css|u:dev:MediaWiki:InterWikiCSS.css");
/* BEGINNING OF THE PAGE */
/** imports **/
@import url("/load.php?mode=articles&only=styles&articles=MediaWiki:LocalCSS1.css|MediaWiki:LocalCSS2.css|u:dev:MediaWiki:InterWikiCSS.css");
 
/** other styles **/
.example { 
    styling
}
But these are not the only ways to import CSS! It's also possible to import CSS using JavaScript pages through importArticles. Read more on this page and how to import both JavaScript and CSS on this one. You might also want to check other helpful pages on CSS:

Changelog

  • 02/22/2018 - Responsiveness, support for chat, & edit page header
  • 02/21/2018 - Support for new community header
  • 02/20/2016 – Fixes
  • 09/06/2015 – Launch version