Template:Button: Difference between revisions

Jump to navigation Jump to search
Fixing most of the wrapping; Shorter parameter names; etc
(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>''tc=black''<nowiki>|</nowiki>''cc=white''<nowiki>|</nowiki>''bc=black''<nowiki>|</nowiki>''bw=1''<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


; tc:  <u>T</u>ext <u>c</u>olour, defaults to <tt>black</tt>
; t:  <u>T</u>ext colour, defaults to <tt>black</tt>


; cc:  Button <u>c</u>ap <u>c</u>olour, defaults to <tt>white</tt>
; c:  Button <u>c</u>ap colour, defaults to <tt>white</tt>


; bc:  <u>B</u>order <u>c</u>olour, defaults to <tt>black</tt>
; b:  <u>B</u>order colour, defaults to <tt>black</tt>


; bw<u>B</u>order <u>w</u>idth in pixels, defaults to <tt>1</tt>
; wBorder <u>w</u>idth in pixels, defaults to <tt>1</tt>


=== Colours ===
=== Colours ===
Line 31: Line 31:


== Examples ==
== Examples ==
<pre>{{button|HDG}}</pre>
<nowiki>{{button|HDG}}</nowiki>
<span style="border: 1px solid black; padding: 1px 3px; background: white; font-family: inherit; color: black; font-size: 0.85em;">HDG</span>
{{button|HDG}}


<nowiki>{{button|'''ALT'''|t=black|c=#AFA|b=gray|w=2}}</nowiki>
{{button|'''ALT'''|t=black|c=#AFA|b=gray|w=2}}


<pre>{{button|'''ALT'''|tc=black|cc=#AFA|bc=gray|bw=2}}</pre>
<nowiki>{{button|'''ILS'''|t=#AFA|c=gray|b=black|w=2}}</nowiki>
<span style="border: 2px solid gray; padding: 1px 3px; background: #AFA; font-family: inherit; color: black; font-size: 0.85em;">'''ALT'''</span>
{{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 {{key press|{{!}}}} which would require you to insert <code><nowiki>{{!}}</nowiki></code> instead of <code>{{!}}</code>, since using a "{{!}}" inside a template will break it.
* 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.


* This template currently wraps, so that for example {{button|ALT HOLD}} may end up having two half boxes with "Page" at the end of one line and "up" at the beginning of the following line.
* If a line breaks right before the template the left border will stay on the previous line.


[[Category:Templates]]
[[Category:Templates]]
}}
}}
</noinclude>
</noinclude>

Navigation menu