Template:Button: Difference between revisions
Jump to navigation
Jump to search
(Style) |
(Fixing most of the wrapping; Shorter parameter names; etc) |
||
Line 1: | Line 1: | ||
<noinclude>{{WIP}}</noinclude><span style="border: {{{bw|1}}}px solid {{{bc|black}}}; padding: 1px 3px; background: {{{cc|white}}}; font-family: inherit; color: {{{tc|black}}}; font-size: 0.85em;">{{{1|Text}}}</span><noinclude> | <noinclude>{{WIP}}</noinclude><span style="border: {{{bw|1}}}px solid {{{bc|black}}}; padding: 1px 3px; background: {{{cc|white}}}; font-family: inherit; color: {{{tc|black}}}; font-size: 0.85em; white-space: nowrap;">{{{1|Text}}}</span><noinclude> | ||
{{Informative template|1= | {{Informative template|1= | ||
__NOTOC__ | __NOTOC__ | ||
Line 6: | Line 6: | ||
== Usage == | == Usage == | ||
<nowiki>{{</nowiki>'''button'''<nowiki>|</nowiki>text<nowiki>|</nowiki>'' | <nowiki>{{</nowiki>'''button'''<nowiki>|</nowiki>text<nowiki>|</nowiki>''t=black''<nowiki>|</nowiki>''c=white''<nowiki>|</nowiki>''b=black''<nowiki>|</nowiki>''w=1''<nowiki>}}</nowiki> | ||
The only mandatory parameter is '''text'''. | The only mandatory parameter is '''text'''. | ||
Line 12: | Line 12: | ||
; text: Button text | ; text: Button text | ||
; | ; t: <u>T</u>ext colour, defaults to <tt>black</tt> | ||
; | ; c: Button <u>c</u>ap colour, defaults to <tt>white</tt> | ||
; | ; b: <u>B</u>order colour, defaults to <tt>black</tt> | ||
; | ; w: Border <u>w</u>idth in pixels, defaults to <tt>1</tt> | ||
=== Colours === | === Colours === | ||
Line 31: | Line 31: | ||
== Examples == | == Examples == | ||
< | <nowiki>{{button|HDG}}</nowiki> | ||
{{button|HDG}} | |||
<nowiki>{{button|'''ALT'''|t=black|c=#AFA|b=gray|w=2}}</nowiki> | |||
{{button|'''ALT'''|t=black|c=#AFA|b=gray|w=2}} | |||
< | <nowiki>{{button|'''ILS'''|t=#AFA|c=gray|b=black|w=2}}</nowiki> | ||
{{button|'''ILS'''|t=#AFA|c=gray|b=black|w=2}} | |||
== Known issues == | == Known issues == | ||
Line 42: | Line 44: | ||
* In some cases workarounds will be required. One of them is for example text containing a | * In some cases workarounds will be required. One of them is for example text containing a pipe character ({{!}}) which would require you to insert <code><nowiki>{{!}}</nowiki></code> instead of <code>{{!}}</code>, since using a "{{!}}" inside a template will break it. | ||
* | * If a line breaks right before the template the left border will stay on the previous line. | ||
[[Category:Templates]] | [[Category:Templates]] | ||
}} | }} | ||
</noinclude> | </noinclude> |
Revision as of 20:52, 28 May 2014
Work in progress This article or section will be worked on in the upcoming hours or days. See history for the latest developments. |
Text
The following template description is not displayed when the template is inserted in an article.
Goal
This template is used in running text to illustrate button presses and lit indicators. It allows the use of alternate colours and border widths.
Usage
{{button|text|t=black|c=white|b=black|w=1}}
The only mandatory parameter is text.
- text
- Button text
- t
- Text colour, defaults to black
- c
- Button cap colour, defaults to white
- b
- Border colour, defaults to black
- w
- Border width in pixels, defaults to 1
Colours
The template uses cascading style sheet (CSS) colours, and there are five ways to define the colours:
- Through colour keywords (either of aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white or yellow);
- as three hexadecimal values #rgb, like #F00 for red,
- as six hexadecimal values #rrggbb, like #00FF00 for green,
- as three integers 0-255 rgb(r,g,b), like rgb(0,255,255) for yellow
- as three percentages rgb(r, g, b), like rgb(100%, 0%, 0%) for red
In other words F = FF = 255 = 100%.
Examples
{{button|HDG}}
HDG
{{button|'''ALT'''|t=black|c=#AFA|b=gray|w=2}}
ALT
{{button|'''ILS'''|t=#AFA|c=gray|b=black|w=2}}
ILS
Known issues
- There seems to be a problem adding parameters to the style attribute, in which case this would have been a futile exercise...
- In some cases workarounds will be required. One of them is for example text containing a pipe character (|) which would require you to insert
{{!}}
instead of|
, since using a "|" inside a template will break it.
- If a line breaks right before the template the left border will stay on the previous line.