Template:WarnAlt: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(The subpages are elegant but make adjusting the styling of the different sized messages en masse difficult. Adding .warning, .caution etc entries to MediaWiki:Common.css or installing TemplateStyles would be ideal) |
||
Line 1: | Line 1: | ||
{{#switch: {{{size | {{{2|}}} }}} | |||
| #default = {{error|The severity and size arguments are required.}} | |||
| large=<div style="padding: 1.2em; margin-top: 0.5em; border-top-width: 0.4em; border-radius: 0.20em; box-shadow: 2px 2px #F7F8F9; background-color: #{{#switch: {{{severity| {{{1}}} }}} | |||
<!-- large box background colors --> | |||
| danger=fee7e6 | |||
| warning=fceee6 | |||
| caution=fcf8e6 | |||
| note|custom=f8f9fa | |||
}}; border: 1px solid #{{#switch: {{{severity| {{{1}}} }}} | |||
<!-- large box border colors --> | |||
| danger=bf3333 | |||
| warning=df5c15 | |||
| caution=f1cc43 | |||
| note|custom=4666c8 | |||
}};"><table><tr><td>[[File:{{#switch: {{{severity| {{{1}}} }}} | |||
<!-- large box icons --> | |||
| danger=OOjs UI icon alert-destructive.svg | |||
| warning=OOjs UI icon alert-warning.svg | |||
| caution=OOjs UI icon alert-yellow.svg | |||
| note=OOjs UI icon information-progressive.svg | |||
| custom={{{custom_icon}}} | |||
}}|35px|left|link=|alt={{{severity}}}]]</td><td>'''{{#switch: {{{severity| {{{1}}} }}} | |||
<!-- large box labels --> | |||
| danger=DANGER | |||
| warning=WARNING | |||
| caution=CAUTION | |||
| note=NOTE | |||
| custom={{{custom_label}}} | |||
}}''' {{{message| {{{3|}}} }}}</td></div> | |||
| medium|med=<table style="padding: 0.5em; background-color: #{{#switch: {{{severity| {{{1}}} }}} | |||
<!-- medium box background colors --> | |||
| danger=fee7e6 | |||
| warning=fceee6 | |||
| caution=fcf8e6 | |||
| note|custom=f8f9fa | |||
}}; border: 1px solid #{{#switch: {{{severity| {{{1}}} }}} | |||
<!-- medium box border colors --> | |||
| danger=bf3333 | |||
| warning=df5c15 | |||
| caution=f1cc43 | |||
| note|custom=4666c8 | |||
}};"><tr><td nowrap="true">[[File:{{#switch: {{{severity| {{{1}}} }}} | |||
<!-- medium box icons --> | |||
| danger=OOjs UI icon alert-destructive.svg | |||
| warning=OOjs UI icon alert-warning.svg | |||
| caution=OOjs UI icon alert-yellow.svg | |||
| note=OOjs UI icon information-progressive.svg | |||
| custom={{{custom_icon}}} | |||
}}|18px|text-bottom|link=|alt={{{severity}}}]] '''{{#switch: {{{severity| {{{1}}} }}} | |||
<!-- medium box labels --> | |||
| danger=DANGER | |||
| warning=WARNING | |||
| caution=CAUTION | |||
| note=NOTE | |||
| custom={{{custom_label}}} | |||
}}''' {{{message| {{{3|}}} }}}</table> | |||
| small=[[File:{{#switch: {{{severity| {{{1}}} }}} | |||
<!-- small box icons --> | |||
| danger=OOjs UI icon alert-destructive.svg | |||
| warning=OOjs UI icon alert-warning.svg | |||
| caution=OOjs UI icon alert-yellow.svg | |||
| note=OOjs UI icon information-progressive.svg | |||
| custom={{{custom_icon}}} | |||
}}|18px|text-bottom|link=|alt={{{severity}}}]] '''{{#switch: {{{severity| {{{1}}} }}} | |||
| danger=DANGER | |||
| warning=WARNING | |||
| caution=CAUTION | |||
| note=NOTE | |||
| custom={{{custom_label}}} | |||
}}''' {{{message| {{{3|}}} }}} | |||
}}<noinclude><templatedata> | }}<noinclude><templatedata> | ||
{ | { | ||
Line 20: | Line 83: | ||
], | ], | ||
"type": "string", | "type": "string", | ||
"required": true, | "required": true, | ||
"aliases": [ "1" ] | "aliases": [ "1" ] | ||
Line 33: | Line 95: | ||
], | ], | ||
"type": "string", | "type": "string", | ||
"required": true, | "required": true, | ||
"aliases": [ "2" ] | "aliases": [ "2" ] | ||
Line 42: | Line 103: | ||
"example": "Caps may retain charge after poweroff", | "example": "Caps may retain charge after poweroff", | ||
"type": "string", | "type": "string", | ||
"required": | "required": false, | ||
"aliases": [ "3" ] | "aliases": [ "3" ] | ||
}, | }, |
Revision as of 21:11, 17 February 2022
Error: The severity and size arguments are required.
Create a warning box to get the users attention
Parameter | Description | Type | Status | |
---|---|---|---|---|
Severity and Color | severity 1 | The severity of the warning that will also determine the color of the warning.
| String | required |
Warning Box Size | size 2 | The size or type of the warning to be created.
| String | required |
Displayed Text | message 3 | The text to be displayed in the warning box.
| String | optional |
Custom Label | custom_label | A custom label to be displayed before the message in boldface. Required when ''severity'' is set to ''custom''.
| String | optional |
Custom Icon | custom_icon | An image file to be displayed as an icon before the label. Required when ''severity'' is set to ''custom''. Do not include ''File:''. Since the custom option displays in a blue theme, blue-colored icons are suggested.
| String | optional |