Template:Color: Difference between revisions
More actions
Created page with "<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}}} | #default = {{{1}}} | Eribu = #2e1816 | Absu = #38174d | Zi = #1d226b | Kur = #42281a | Indi = #165450 | Ukkin-Na = #155035 | Edin = #273c40 | E-Kur-Mah = #503d2a | Mar-Uru = #3c3e49 }}; border-radius:5px;}}|{{{2}}}}}</includeonly></onlyinclude> This template puts text inside a box..." Tag: 2017 source edit |
New features: Text color. Inline usage. Tags: Reverted 2017 source edit |
||
| Line 1: | Line 1: | ||
<onlyinclude><includeonly>{{#if:{{{ | <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 = {{{ | 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;}}|{{{ | }};|}} {{#if:{{{txt|}}}|color:{{{txt}}};|}} border-radius:5px;}}|{{{1}}}}}</includeonly></onlyinclude> | ||
This template puts text inside a box of a specified background color. | 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>{{ | Syntax: {{color|txt=purple|<nowiki>{{color|bg=<BackgroundColor>|txt=<TextColor>|format=?|<Content>}}</nowiki>}}<br> | ||
If <nowiki>< | 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|format=li}}, if 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. | |||
Revision as of 03:17, 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 {{{1}}}, if 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.