Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Color: Difference between revisions

Template page
Xhamon (talk | contribs)
Undo revision 11674. Bugged.
Tags: Undo Reverted
Xhamon (talk | contribs)
Documentation bugfix.
Tag: 2017 source edit
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<onlyinclude><includeonly>{{#if:{{{1|}}}|{{#tag:span|{{{2}}}|style=display:inline-block; min-width:200px; padding:1px 10px 1px 5px; margin:1px; background-color:{{#switch: {{{1}}}
<onlyinclude><includeonly>{{#if:{{{txt|}}}{{{bg|}}}|{{#tag:span|{{{1}}}|style=display:inline-block; {{#ifeq:{{{format|}}}|li|min-width:200px; padding:1px 10px 1px 5px; margin:1px;|}} {{#if:{{{bg|}}}|
  | #default = {{{1}}}
background-color:{{#switch: {{{bg}}}
  | #default = {{{bg}}}
  | Eribu = #2e1816
  | Eribu = #2e1816
  | Absu = #38174d
  | Absu = #38174d
Line 10: Line 11:
  | E-Kur-Mah = #503d2a
  | E-Kur-Mah = #503d2a
  | Mar-Uru = #3c3e49
  | Mar-Uru = #3c3e49
}}; border-radius:5px;}}|{{{2}}}}}</includeonly></onlyinclude>
}};|}} {{#if:{{{txt|}}}|color:{{{txt}}};|}} border-radius:5px;}}|{{{1}}}}}</includeonly></onlyinclude>


This template puts text inside a box of a specified background color. It is most useful for indicating in which area something is. (Note: Currently, the template can only be applied to list items. More formats (like for inline text) are planned to be added later.)<br>
This template puts text inside a box of a specified background color, or changes the color of text, or both. Background color is most useful for indicating in which area of the game something is.<br>
This template supports HTML/CSS color names, hex codes (#000000), and AV1 area names. (AV2 area names are planned to be added later.)
This template supports HTML/CSS color names, hex codes (#000000), and AV1 area names. (AV2 area names are planned to be added later.)


Syntax: <nowiki>{{Color|<ColorCode>|<Content>}}</nowiki><br>
Syntax: {{color|txt=purple|<nowiki>{{color|bg=<BackgroundColor>|txt=<TextColor>|format=<?>|<Content>}}</nowiki>}}<br>
If <nowiki><ColorCode></nowiki> is empty, ie: <nowiki>{{Color||<Content>}}</nowiki>, this template is ignored and will return <nowiki><Content></nowiki> as is.<br>
If {{color|txt=purple|<nowiki><BackgroundColor></nowiki>}} and {{color|txt=purple|<nowiki><TextColor></nowiki>}} are both empty, ie: {{color|txt=purple|<nowiki>{{color|<Content>}}</nowiki>}}, this template is ignored and will return {{color|txt=purple|<nowiki><Content></nowiki>}} as is.<br>
If {{color|txt=purple|<nowiki>format=li</nowiki>}} and there is a background, the style of the box is adjusted to look better in lists. If the format is something else (or omitted), the box is made to be used inside paragraphs of text.

Latest revision as of 03:39, 7 October 2022


This template puts text inside a box of a specified background color, or changes the color of text, or both. Background color is most useful for indicating in which area of the game something is.
This template supports HTML/CSS color names, hex codes (#000000), and AV1 area names. (AV2 area names are planned to be added later.)

Syntax: {{color|bg=<BackgroundColor>|txt=<TextColor>|format=<?>|<Content>}}
If <BackgroundColor> and <TextColor> are both empty, ie: {{color|<Content>}}, this template is ignored and will return <Content> as is.
If format=li and there is a background, the style of the box is adjusted to look better in lists. If the format is something else (or omitted), the box is made to be used inside paragraphs of text.