Template:Color square: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
(Created page with "<includeonly><span style="width: 1rem; height: 1rem; display: inline-block; vertical-align: middle; border-radius: 0.4rem; {{#ifeq: {{{border|}}} | true | border: 1px solid #000000; }} background-color: {{{1}}}"> </span></includeonly><noinclude> This template displays a colored square alongside text for illustrative purposes. Inspired by the Ink template on Inkipedia. ==Usage== <code><nowiki>{{color square|blue}}</nowiki></code> :{{color...")
 
m (allows the border color to be customized but kept it backwards-compatible to accept border=true as well)
Line 1: Line 1:
<includeonly><span style="width: 1rem; height: 1rem; display: inline-block; vertical-align: middle; border-radius: 0.4rem; {{#ifeq: {{{border|}}} | true | border: 1px solid #000000; }} background-color: {{{1}}}">&nbsp;</span></includeonly><noinclude>
<includeonly><span style="width:{{{width|1rem}}};height:{{{height|1rem}}};background:{{{bg|{{{1|none}}}}}};{{#if:{{{border|{{{2|}}}}}}|border:{{{border-width|1px}}} solid {{{2|#000}}};}}border-radius:{{{border-radius|0.4rem}}};display:inline-block;vertical-align:middle"></span></includeonly><noinclude>
This template displays a colored square alongside text for illustrative purposes. Inspired by the [[inkipedia:Template:Ink|Ink template on Inkipedia]].
This template displays a colored square which can be used alongside text for illustrative purposes. Inspired by the [[inkipedia:Template:Ink|Ink template on Inkipedia]].
 
The first parameter is the background color and an optional second parameter adds a border of the specified color (alternatively, a <code>border=true</code> parameter can be used to add a black border).


==Usage==
==Usage==
Line 6: Line 8:
:{{color square|blue}}
:{{color square|blue}}


<code><nowiki>{{color square|#FA0E24|border=true}}</nowiki></code>
<code><nowiki>{{color square|#FA0E24|black}}</nowiki></code>
:{{color square|#FA0E24|border=true}}
:{{color square|#FA0E24|black}}


[[Category:Formatting templates]]</noinclude>
[[Category:Formatting templates]]</noinclude>

Revision as of 16:47, February 5, 2025

This template displays a colored square which can be used alongside text for illustrative purposes. Inspired by the Ink template on Inkipedia.

The first parameter is the background color and an optional second parameter adds a border of the specified color (alternatively, a border=true parameter can be used to add a black border).

Usage

{{color square|blue}}

{{color square|#FA0E24|black}}