Template:Alert/doc: Difference between revisions

ArrowHead294 (talk | contribs)
m Add documentation on emoji icons.
ArrowHead294 (talk | contribs)
m Update documentation to use label parameter.
Line 8: Line 8:
* <code>text</code>: Message to be displayed in the box.
* <code>text</code>: Message to be displayed in the box.
* <code>icon</code>: Icon to be displayed in the box, if provided. Icons appear on the left side of the message box.
* <code>icon</code>: Icon to be displayed in the box, if provided. Icons appear on the left side of the message box.
:: The <code>icon</code> parameter is for images. If an {{w|emoji}} is used as an icon, it should be wrapped in <code>{{nowrap|<nowiki><span class{{=}}"alert-icon">…</span></nowiki>}}</code> as follows:
:: The <code>icon</code> parameter is for images. If an {{w|emoji}} is used as an icon, <code>label</code> should be used instead.
:: <syntaxhighlight lang="wikitext">| text=<span class{{=}}"alert-icon">&#xHHHH;</span>'''Text:''' {{{1|}}}</syntaxhighlight>
* <code>icon size</code>: Size of the icon displayed. Default is 20px.
* <code>label</code>: Displays a label such as "warning", "note", or "tip". This is also useful if an emoji is used as the icon instead of an image. Use as follows:
:: <syntaxhighlight lang="wikitext">
| label = <span class{{=}}"alert-icon">&#xHHHH;</span>'''Text:'''
| text = {{{1|}}}
</syntaxhighlight>
:: where <code>&amp;#xHHHH;</code> represents the hexadecimal {{w|HTML entity}} representation of the emoji in mind (e.g. use <code>&amp;#x1F642;</code> for &#x1F642;</code>).
:: where <code>&amp;#xHHHH;</code> represents the hexadecimal {{w|HTML entity}} representation of the emoji in mind (e.g. use <code>&amp;#x1F642;</code> for &#x1F642;</code>).
* <code>icon size</code>: Size of the icon displayed. Default is 20px.


=== Types and examples ===
=== Types and examples ===