コミュニティセントラル
ヘルプ
このヘルプには更新、または翻訳されていないコンテンツがあります。どなたでも翻訳にご協力いただくことができます。
原文 : w:Help:Community CSS and JS

コミュニティのCSSとJavaScriptは、各Wikiのアドミンが、Wikiの見た目や動作にカスタマイズを行うためのものです。

Local customization offers great challenge and satisfaction to many editors, so we at Fandom encourage you to try your hand at it. But there are two important things to keep in mind as you do:

CSS

CSSsyntaxHL

黒基調の色設定がされたコミュニティのCSSを編集

WikiのCSSをカスタマイズするには、MediaWiki:Common.cssを編集します。

各Wikiで行っているカスタマイズに影響するような変更については、英語版コミュニティセントラルの技術更新情報で毎週お知らせしています。

日本語コミュニティセントラルのフォーラムでは、カスタマイズを行う上でよくわからないこと、発生している問題などについて、ほかのユーザーに助けを求めることができます。

CSS pages

MediaWiki:Common.css is loaded first. The contents will be applied before MediaWiki:Wikia.css/MediaWiki:FandomDesktop.css. For most communities this doesn't matter, but if you use both pages and @import rules (like for importing custom fonts), then these rules must be added at the top of MediaWiki:Common.css to function.

Wikia.css (Oasisスキン)

MediaWiki:Wikia.cssへは、アドミンダッシュボードからも「CSS」リンク経由でアクセスできます。
The use of Wikia.css will be replaced with a new file once UCX is released.

FandomDesktop.css (FandomDesktopスキン)

MediaWiki:FandomDesktop.css は、FandomDesktopスキンで読み込まれます。

JavaScript

With the exception of imported scripts from the Fandom Developers Wiki through ImportJS, you cannot add custom community JS until you ask Fandom to turn it on for you. After it's enabled, you can add freeform JS, rather than only imports. JSページのコードはWikiを訪れる全てのユーザー向けに読み込まれます。 独自のJSを追加するには、MediaWiki:Common.jsを編集します。

注意:

  • セキュリティ上の理由により、コミュニティJavaScriptへの編集後は審査プロセスを通す必要があり、詳細についてヘルプ:JavaScriptの審査プロセスでご案内しています。この機能をコミュニティで導入するには、Fandomスタッフまで申請をお願いいたします
  • Fandom's Open Source Code Libraryでは、多くのスクリプトが公開されており、ImportJS機能を使って手軽に導入することができます。ImportJSを使うと、JavaScriptの審査プロセスを経る必要もなくなります。
  • JavaScriptの誤りはWikiの基本的な機能に支障をきたすおそれがあります。JavaScriptを熟知している方もどうぞご注意ください。
  • よくわからないJavaScriptや、信用しきれなかったりセキュリティに問題があったりするソースのJavaScriptを持ち込むのはお控えください。また、個人用JavaScriptページや、その他の安全でないページからJavaScriptをインポートしないでください。詳細についてはヘルプ:JavaScriptの審査プロセスをご覧ください。
  • As with the CSS pages, both Common.js and Wikia.js affect the whole wiki; Wikia.js will be replaced once UCX is released (FandomDesktopスキンでは、MediaWiki:FandomDesktop.js が読み込まれるようになります).

Some technicalities

Changes you make to either CSS or JS are usually not immediately seen upon publication. This is because of a concept called "caching". If you're in the middle of a lengthy period of editing your CSS and JS, you may have to frequently bypass your cache to see your changes.

Also, Fandom's load order—the priority given to each of the various pages used to customize your wiki—is crucial for administrators to understand. A common reason that some customizations aren't seen is because a later-loading page effectively cancels a declaration made on an earlier-loading page.

関連情報

その他のヘルプとフィードバック