すべてのMediaWikiスキンにおいて、各ユーザはMemory Alphaの外観をカスタマイズすることが許可されています。Cascading Style Sheets(CSS)とJavaScript(JS)はHTML要素、クラス及びIDタグのひとつがHTMLコードで指定したセレクタに関して使用されます。従って、ユーザはMemory Alphaの外観に変更を加えることができます。
Cascading style sheets (CSS)[]
デフォルトのスタイルシートは以下の位置にあります。
- Monobook: http://memory-alpha.org/ja/skins/monobook/main.css と MediaWiki:Monobook.css
- Classic (Standard): http://memory-alpha.org/ja/skins/common/wikistandard.css と MediaWiki:Standard.css
- Cologne Blue: http://memory-alpha.org/ja/skins/common/cologneblue.css と MediaWiki:Cologneblue.css
- Nostalgia: http://memory-alpha.org/ja/skins/common/nostalgia.css と MediaWiki:Nostalgia.css
尚、上記のページは管理者のみが編集することが許されています。一般のユーザは以下のページを編集することで、自分自身のスタイルシートをカスタマイズすることができます。
- Monobook: http://memory-alpha.org/ja/index.php/User:USERNAME/monobook.css
- Classic (Standard): http://memory-alpha.org/ja/index.php/User:USERNAME/standard.css
- Cologne Blue: http://memory-alpha.org/ja/index.php/User:USERNAME/cologneblue.css
- Nostalgia: http://memory-alpha.org/ja/index.php/User:USERNAME/nostalgia.css
例[]
文字色である白を際立たせるために背景色を変えることができます。
/* make the background color darker for the main content section */
body {
background-image: url(/graphics/background_monobook.gif);
background-repeat: repeat;
background-color: #202020;
}
#content, #footer {
background-color: #202020;
color: #FFFFFF;
}
.pBody {
background-color: #202020;
color: #FFFFFF;
}
リンクの表示方法を変更し、マウスカーソルを当てることでリンクが表示されるスタイルに変更させることができます。
/* make underlines in links appear only on hover */
a { text-decoration: none; }
a:hover { text-decoration: underline; }
リンクの表示カラーはデフォルトでは青ですが、この色を変更することができます。また、外部リンク等リンクの種類によってリンクの表示カラーを変更できます。
/* change default link colors */
a.new { color:#ff6633; }
a.stub { color: #772233; }
a.external, a.extiw { color:#999999; }
a.mailto { color: #FFCC00; }
#p-personal { color: #00CCFF !important; }
ユーザ名の横の人型アイコンを非表示にできます。
/* suppress the person icon by your username */
li#pt-userpage { background: none }
Memory Alphaのロゴを非表示にできます。
/* don't use any logo, move the boxes onto that area instead */
#p-logo { display: none }
#column-one { padding-top: 0; }
Mozilla、Firefox、またはCaminoのようなGecko-powered browserを使用している場合には、丸コーナースタイルを作成することもできます。
/* make a few corners round, only supported by moz/firefox/other gecko browsers for now */
#p-cactions ul li, #p-cactions ul li a {
-moz-border-radius-topleft: 1em;
-moz-border-radius-topright: 1em;
}
#content {
-moz-border-radius-topleft: 1em;
-moz-border-radius-bottomleft: 1em;
}
div.pBody {
-moz-border-radius-topright: 1em;
-moz-border-radius-bottomright: 1em;
}
/* same following the css3 draft specs, any browsers supporting this? */
#p-cactions ul li, #p-cactions ul li a {
border-radius-topleft: 1em;
border-radius-topright: 1em;
}
#content {
border-radius-topleft: 1em;
border-radius-bottomleft: 1em;
}
div.pBody {
border-radius-topright: 1em;
border-radius-bottomright: 1em;
}
印刷された場合にのみ表示されるカスタマイズを加えることもできます。
/*
** Place all print-specific rules in an @media print block.
*/
/* save ink and paper with very small fonts */
@media print {
#footer,
#content,
body { font-size: 8pt !important; }
h1 { font-size: 17pt }
h2 { font-size: 14pt }
h3 { font-size: 11pt }
h4 { font-size: 9pt }
h5 { font-size: 8pt }
h6 {
font-size: 8pt;
font-weight: normal;
}
}
/* Advanced things: using :before and :after it's possible to add formatting
this rule adds the full href of a link after it (not needed in the current version): */
@media print {
#content a:link:after,
#content a:visited:after {
content: " <" attr(href) "> ";
}
}
JavaScript[]
以下のページにスクリプトを配置することによって、JavaScriptをカスタマイズできます。
- Monobook: http://memory-alpha.org/ja/index.php/User:USERNAME/monobook.js
- Standard: http://memory-alpha.org/ja/index.php/User:USERNAME/standard.js
- Cologne Blue: http://memory-alpha.org/ja/index.php/User:USERNAME/cologneblue.js
- Nostalgia: http://memory-alpha.org/ja/index.php/User:USERNAME/nostalgia.js
例[]
- You can add a set of mirrored tabs to the bottom of the #content section of the layout; see Meta-Wiki: User styles - bottom tabs.
- You can change the access keys by changing some elements in the "ta" array (see [1]). For example:
ta['ca-nstab-main'] = new Array('c','View the content page');
関連項目[]
- Help:プリファレンス
- 外装の詳細設定 MediaWiki日本語版の記事
- Meta-Wiki: Gallery of user styles ユーザーページのカスタマイズについて英語記事