Template:Notice: Difference between revisions
From MiiWiki
Jump to navigationJump to search
mNo edit summary |
PinkYoshiFan (talk | contribs) m (evidently there's some sort of whitespace trimming in the parser here, using nbsp to bypass that) |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
--><div style="background-color: {{{bg|#ffe423}}}; background-image: linear-gradient(transparent, {{#switch:{{{textcolor|#000}}}|#fff|#fffff|#FFF|#FFFFF = rgba(255,255,255,.15)|rgba(0,0,0,.15)}}); border-radius: 15px;"> | --><div style="background-color: {{{bg|#ffe423}}}; background-image: linear-gradient(transparent, {{#switch:{{{textcolor|#000}}}|#fff|#fffff|#FFF|#FFFFF = rgba(255,255,255,.15)|rgba(0,0,0,.15)}}); border-radius: 15px; max-width: -moz-fit-content; max-width: {{{maxwidth|fit-content}}}; min-width: 300px; overflow: hidden; margin-bottom: 5px;"> | ||
<div class="{{#ifeq:{{NAMESPACE}}|{{TALKSPACE}}|{{#ifeq:{{{small|}}}|yes|small|standard}}-talk}} messagebox" style="background: transparent; display: flex; gap: 10px; align-items: center; border-radius: 15px; border: 3px solid rgba(255,255,255,.5); color: {{{textcolor|#000}}}; padding: 5px 10px"> | <div class="{{#ifeq:{{NAMESPACE}}|{{TALKSPACE}}|{{#ifeq:{{{small|}}}|yes|small|standard}}-talk}} messagebox" style="background: transparent; display: flex; gap: 10px; align-items: center; border-radius: 15px; border: 3px solid rgba(255,255,255,.5); color: {{{textcolor|#000}}}; padding: 5px 10px; margin: 0"> | ||
<div>[[File:{{{image|Needed.png}}}|{{{width|50px}}}|{{{alt-text|}}}]]</div> | <div>[[File:{{{image|Needed.png}}}|{{{width|50px}}}|{{{alt-text|}}}]]</div> | ||
<div><!-- | <div><!-- | ||
-->{{#if:{{{header|}}}|'''Notice: {{{header}}}'''|}} | -->{{#if:{{{header|}}}|'''{{#if:{{{suppressnotice|}}}||Notice: }}{{{header}}}'''<br>|}}<!-- | ||
-->{{{message|}}} | -->{{{message|}}} | ||
</div> | </div> | ||
Line 10: | Line 10: | ||
</div><!-- | </div><!-- | ||
--></includeonly> | --></includeonly> | ||
<noinclude> | <!-- | ||
spacing between template and doc | |||
--><noinclude> | |||
{{notice | {{notice | ||
|header=Building | |header=Building | ||
Line 30: | Line 34: | ||
| The color of the text. Change to <code>#fff</code> (white) if the background is dark. | | The color of the text. Change to <code>#fff</code> (white) if the background is dark. | ||
| style="text-align: center" | <code>#000</code> | | style="text-align: center" | <code>#000</code> | ||
|- | |||
| style="text-align: center" | <code>maxwidth</code> | |||
| Maximum width of the notice. Preferable to avoid percentage-based values. | |||
| style="text-align: center" | <code>fit-content</code> | |||
|- | |- | ||
| style="text-align: center" | <code>image</code> | | style="text-align: center" | <code>image</code> | ||
Line 49: | Line 57: | ||
| style="text-align: center" | <code>message</code> | | style="text-align: center" | <code>message</code> | ||
| Message of the notice. | | Message of the notice. | ||
| style="text-align: center" | None | |||
|- | |||
| style="text-align: center" | <code>suppressnotice</code> | |||
| Removes "Notice: " from the header if filled out. | |||
| style="text-align: center" | None | | style="text-align: center" | None | ||
|} | |} | ||
Line 84: | Line 96: | ||
</div> | </div> | ||
</div> | </div> | ||
===Raw code=== | |||
<pre> | |||
{{Notice | |||
|bg= | |||
|textcolor= | |||
|maxwidth= | |||
|image= | |||
|width= | |||
|alt-text= | |||
|header= | |||
|message= | |||
|suppressnotice= | |||
}} | |||
</pre> | |||
[[Category:Meta-templates]] | [[Category:Meta-templates]] | ||
</noinclude> | </noinclude> |
Latest revision as of 15:43, 4 January 2024
Template parameters
Parameter | Description | Default |
---|---|---|
bg
|
The color of the background. This will affect the border color automatically. | #ffe423
|
textcolor
|
The color of the text. Change to #fff (white) if the background is dark.
|
#000
|
maxwidth
|
Maximum width of the notice. Preferable to avoid percentage-based values. | fit-content
|
image
|
Image of the notice. | Needed.png
|
width
|
Width of the image. | 50px
|
alt-text
|
Alt text of the image. | None |
header
|
Header of the notice. | None |
message
|
Message of the notice. | None |
suppressnotice
|
Removes "Notice: " from the header if filled out. | None |
Color examples
Raw code
{{Notice |bg= |textcolor= |maxwidth= |image= |width= |alt-text= |header= |message= |suppressnotice= }}