Jump to content
Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Message box: Difference between revisions

Template page
Create static (ParserFunctions-free) License Mojang template chain
 
m Split remaining inline CSS into /styles.css; delegate shared infobox chrome to Template:Infobox for wiki-wide visual parity
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div class="msgbox" style="display:flex;box-sizing:border-box;align-items:center;width:auto;max-width:{{{width|90%}}};padding:.4em .8em;margin:0 auto 1em auto;background:{{{bgcol|#ededed}}};border-left:4px solid {{{linecol|#d9d9d9}}};">
<includeonly><templatestyles src="Template:Message box/styles.css" /><div class="loka-msgbox" style="--msgbox-width:{{{width|90%}}};--msgbox-bg:{{{bgcol|#f4f4f4}}};--msgbox-line:{{{linecol|#c8c8c8}}};"><div class="loka-msgbox-icon">[[File:{{{image|License none.png}}}|{{{imagesize|64px}}}|link=|alt=]]</div><div class="loka-msgbox-body"><div class="loka-msgbox-title">{{{title|}}}</div><div class="loka-msgbox-text">{{{text|}}}</div></div></div></includeonly><noinclude>
<div style="margin:0 1.5em 0 .5em;flex-shrink:0;">[[File:{{{image|License none.png}}}|{{{imagesize|64px}}}|link=|alt=]]</div>
<div style="width:100%;">
<div style="font-weight:bold;">{{{title|}}}</div>
<div>{{{text|}}}</div>
</div>
</div><noinclude>
Generic styled notice box. Parameters: '''image''' (filename, no <code>File:</code> prefix), '''imagesize''', '''title''', '''text''', '''bgcol''', '''linecol''', '''width'''. Used by [[Template:License]].
Generic styled notice box. Parameters: '''image''' (filename, no <code>File:</code> prefix), '''imagesize''', '''title''', '''text''', '''bgcol''', '''linecol''', '''width'''. Used by [[Template:License]].


This is a static, ParserFunctions-free adaptation of [https://minecraft.wiki/w/Template:Message_box minecraft.wiki's Template:Message box] for wikis without the ParserFunctions extension.
<code>bgcol</code>/<code>linecol</code>/<code>width</code> are set per call (each license type could in principle use different colours), so they're passed through as CSS custom properties rather than living in the stylesheet; everything else is static and lives in [[Template:Message box/styles.css]].
 
[[Category:Templates]]
</noinclude>
</noinclude>

Latest revision as of 05:41, 18 August 2026

Generic styled notice box. Parameters: image (filename, no File: prefix), imagesize, title, text, bgcol, linecol, width. Used by Template:License.

bgcol/linecol/width are set per call (each license type could in principle use different colours), so they're passed through as CSS custom properties rather than living in the stylesheet; everything else is static and lives in Template:Message box/styles.css.