Difference between revisions of "Template:Colored box"

From Confrontation.wiki
Jump to navigation Jump to search
en>Shirayuki
m (Protected "Template:Colored box": Excessive vandalism ([Edit=Allow only autoconfirmed users] (expires 02:17, 1 July 2021 (UTC)) [Move=Allow only autoconfirmed users] (expires 02:17, 1 July 2021 (UTC))))
en>Tacsipacsi
(add {{{class}}} parameter for other template using TemplateStyles, use TemplateStyles CSS instead of {{clr}}, produce a single outermost HTML element)
Line 1: Line 1:
<templatestyles src="Colored box/style.css"/><div class="mw-tpl-colorbox" style="{{#if:{{{background-content-color|}}}| background-color: {{{background-content-color|#fff}}}; }} {{{style|}}};"><!--
<div class="mw-tpl-colorbox {{{class|}}}" style="{{#if:{{{background-content-color|}}}| background-color: {{{background-content-color|#fff}}}; }} {{{style|}}}"><templatestyles src="Colored box/style.css"/><!--
--><div class="mw-tpl-colorbox-title" style="{{#if:{{{background-title-color|}}}|background-color:{{{background-title-color|#eaecf0}}};}}">{{#if:{{{icon|}}}|[[File:{{{icon}}}|20px|class=colorbox-title-icon|link=|alt=]]&#32;}}<strong style="{{#if:{{{title-color|}}}| color: {{{title-color|#000000}}}; }}">{{{title}}}</strong><!--
--><div class="mw-tpl-colorbox-title" style="{{#if:{{{background-title-color|}}}|background-color:{{{background-title-color|#eaecf0}}};}}">{{#if:{{{icon|}}}|[[File:{{{icon}}}|20px|class=colorbox-title-icon|link=|alt=]]&#32;}}<strong style="{{#if:{{{title-color|}}}| color: {{{title-color|#000000}}}; }}">{{{title}}}</strong><!--
-->{{#if:{{{link|}}}|<div class="mw-tpl-colorbox-title-corner">[[{{{link}}}|<span style="{{#if:{{{link-color|{{{title-color|}}}}}}| color: {{{link-color|{{{title-color|}}}}}}; }}">{{{view-text|view}}}</span>]]</div>}}
-->{{#if:{{{link|}}}|<div class="mw-tpl-colorbox-title-corner">[[{{{link}}}|<span style="{{#if:{{{link-color|{{{title-color|}}}}}}| color: {{{link-color|{{{title-color|}}}}}}; }}">{{{view-text|view}}}</span>]]</div>}}
</div><!--
</div><!--
--><div class="mw-tpl-colorbox-content">
--><div class="mw-tpl-colorbox-content">
{{{content}}}{{clr}}</div>
{{{content}}}
</div>
</div><noinclude>
</div><noinclude>
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>

Revision as of 20:06, 7 June 2021

{{{title}}}

{{{content}}}

Template documentation

This template was imported from w:en:Template:Colored box <templatedata> { "params": { "background-content-color": {}, "class": { "label": "extra classes", "description": "Extra CSS classes to apply to the outermost box (space-separated). This is mainly for other templates using TemplateStyles so that they can scope their CSS to the box, but it may be useful in other cases as well.", "type": "line" }, "style": { "label": "extra styles", "description": "Extra inline CSS rules to apply to the outermost element. Prefer TemplateStyles and using CSS classes if possible when using this template in another template.", "type": "line" }, "background-title-color": {}, "icon": { "type": "wiki-file-name", "suggested": true }, "title-color": {}, "title": { "required": true }, "link": { "type": "wiki-page-name" }, "link-color": {}, "content": { "required": true } }, "description": { "en": "This template is for community pages", "fr": "Le modèle boîte colorée est conçu pour les pages communautaires. Il s'inspire de la page d'accueil de Wikidata. " }, "format": "block" } </templatedata>

Examples

  • {{Colored box|title=TITLE|content=CONTENT}}
TITLE

CONTENT

  • {{Colored box|title=TITLE|link=MediaWiki|content=CONTENT}}
TITLE

CONTENT

  • {{Colored box|title=TITLE|link=MediaWiki|content=CONTENT|view-text=VIEW-TEXT}}
TITLE

CONTENT

  • {{Colored box|title=TITLE|link=MediaWiki|icon=OOjs_UI_icon_download-progressive.svg|content=CONTENT|view-text=VIEW-TEXT}}

CONTENT