Template:Alert/doc: Difference between revisions

m Update default icon size
Ganaram inukshuk (talk | contribs)
rewrite; emphasize (hopefully) usage as a metatemplate
 
(3 intermediate revisions by one other user not shown)
Line 4: Line 4:


=== Usage ===
=== Usage ===
The template accepts three parameters:
The template accepts the following parameters:
* <code>type</code>: Defines the color of the left border; the type should be chosen according to context, not for aesthetic reasons. Types are described in the next section.
* <code>type</code>: Defines the color of the left border; the type should be chosen according to context, not for aesthetic reasons. Types are described in the next section.
* <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. Unlike mbox, alert uses an {{w|emoji}} rather than an image, which should be passed in using its {{w|HTML entity}} representation (e.g. use <code>&amp;#x1F642;</code> for &#x1F642;</code>).
* <code>icon size</code>: Size of the icon displayed. Default is 20px.
* <code>label</code>: A custom label, if provided.
 
Templates that use this metatemplate (namely <code><nowiki>{{note}}</nowiki></code>, <code><nowiki>{{tip}}</nowiki></code>, and <code><nowiki>{{warning}}</nowiki></code>) should have pre-assigned values for <code>type</code>, <code>icon</code>, and <code>label</code>, leaving only <code>text</code> available to be modified.


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