Template:Color box: Difference between revisions

From The World of Gotha
Jump to navigation Jump to search
m (1 revision imported)
m (Copy template from dev.miraheze.org to make it functional)
Line 1: Line 1:
<templatestyles src="Legend/styles.css" /><span class="legend-color" style="{{#if:{{{1|}}}|{{greater color contrast ratio|{{{1}}}|black|white|css=y}}
<includeonly><span style="width: 1em; height: 1em; background: {{{color|{{{1}}}}}}; border: {{{border-width|1px}}} {{{border-style|solid}}} {{{border-color|black}}}; box-sizing: border-box; display: inline-block; margin: 0 0.2em; vertical-align: middle; {{{style}}}"></span></includeonly>
  }}{{#if:{{{3|}}}|color:{{{3}}};
<noinclude>
  }}{{#if:{{{border|}}}|border:1px solid {{{border}}};
{{doc}}
  }}{{#if:{{{padding|}}}|padding:{{{padding}}};}}">{{#if:{{{2|}}}
</noinclude>
      |{{#if:{{{padding|}}}|{{{2}}}|&nbsp;{{{2}}}&nbsp;}}
<!-- Copied from https://dev.miraheze.org/wiki/Template:Color_box with credit to Miraheze user Silicona under CC-BY-SA 4.0 -->
      |&nbsp;}}</span><noinclude>
{{documentation}}</noinclude>

Revision as of 03:15, 12 July 2024


Template documentation

The {{color box}} template places a box with the specified fill color on a page.

The template is copied from https://dev.miraheze.org/wiki/Template:Color_box under Creative Commons CC-BY-SA 4.0. It was created by Miraheze user Silicona.

Usage

Basic usage: {{color box|1}}

Parameters

Parameter Description Type Status Notes
1
color
Box fill color String Required The parameter name is optional
border-width Box border width String Optional Default is 1px
border-style Box border style String Optional Default is solid
border-color Box border color String Optional Default is black
style Other box styles String Optional

Examples

  • {{color box|red}} or {{color box|color=red}}


  • {{color box|yellow|border-width=3px}}


  • {{color box|#90EE90|border-style=dashed}}


  • {{color box|orange|border-color-blue}}


  • {{color box|magenta|style=border-radius:50%;}} →