Template:Colorsquare2: Difference between revisions

From Songs of Syx Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
<div class="colorsquare2" style="background-color: {{{1}}}; height: 12px; width: 12px; float: left; border: 2px solid {{{2}}};">&nbsp;</div>
<div class="colorsquare2" style="background-color: {{{1}}}; height: 12px; width: 12px; float: left; border: 2px solid {{{2}}};">&nbsp;</div>
<noinclude><br /><br />
<noinclude>{{colorsquare2/doc}}[[Category:Templates]]</noinclude>
'''''Note: This is the same as the original "colorsquare2" template, the difference is that the CSS margin-top is adjusted differently.'''''<br />
'''''Use this one instead of a square doesn't align with the text properly.'''''<br />
This template makes a little colored square, where the inside of the box as well as it's border can be customized with any color.<br />The syntax of this template is as follows: <code><nowiki>{{colorsquare|box color|border color}}</nowiki></code><br />
Making a list with these squares can misalign themselves or break pages, so a lot of finesse is needed when using these.<br />
It's also advised to use <code>& nbsp;</code> (with no space between the ampersand and the 'n'. As spaces after the templates can further break things.
[[Category:Templates]]</br /><br />
 
Here's some crude examples of how this can looks.
{| class="wikitable" style="width: 900px;"
|-
|{{colorsquare|red|orange}}Text 1
|-
|{{colorsquare|blue|aqua}}Text 2
|-
|{{colorsquare|green|lime}}Text 3
|}
 
{{colorsquare|red|orange}}Text 4
{{colorsquare|purple|pink}}Text 5
{{colorsquare|lime|green}}Text 6
</noinclude>

Latest revision as of 20:09, 19 November 2021

 
Template Documentation

Description

This template makes a little colored square, where the inside of the box as well as it's border can be customized with any color. Making a list with these squares can misalign themselves or break pages, so a lot of finesse is needed when using these. It's also advised to use &nbsp; (with no space between the ampersand and the 'n'. As spaces after the templates can further break things.
Note: Using this template in a table or div will misalign the color squares and any text next to it. The CSS margin-top value is adjusted differently in this template. Using Template:Colorsquare instead can be used for different alignments. Use this one instead of a square doesn't align with the text properly.

Syntax

{{colorsquare2|box color|border color}}

Examples

{{colorsquare2|purple|yellow}} Some wicked text.

Output:
 

 Some wicked text.
{{colorsquare2|#88ffff|#777777}} Still wicked text.

 

 Still wicked text.