Difference between revisions of "Template:Color"

From Nookipedia, the Animal Crossing wiki
(Undo for now)
(Adding ability to create a colored circle to the left of the text instead of around the text by using the 'small' parameter.)
Line 40: Line 40:
 
| Colorful = linear-gradient(to right, #ff9999,#adebad 40%, #adebad, #adebad 60%, #9999ff)
 
| Colorful = linear-gradient(to right, #ff9999,#adebad 40%, #adebad, #adebad 60%, #9999ff)
 
| #default= #e6e6e6
 
| #default= #e6e6e6
}}; {{roundy|{{{roundy|9px}}}}}; {{#if:{{{height|}}}|line-height:{{{height|}}};}} {{#if:{{{display|}}}|display:{{{display|}}};}} text-align:center; padding:3px; margin:3px; width:{{{width|4.5em}}};"><small>{{{1|Unknown}}}</small></div><noinclude>
+
}}; {{roundy|{{{roundy|9px}}}}}; {{#if:{{{display|}}}|display:{{{display|inline-block}}};}} text-align:center; padding:3px; margin:3px; {{#if:{{{small|}}}|width:{{{width|6px}}}; line-height:{{{height|6px}}}; display:inline-block;">&nbsp;</div><div style="display:inline-block;"><small>{{{1|Unknown}}}</small></div>| width:{{{width|4.5em}}}; {{#if:{{{height|}}}|line-height:{{{height|}}};}}"><small>{{{1|Unknown}}}</small></div>}}<noinclude>
  
 
==Usage==
 
==Usage==
  
 
<pre>
 
<pre>
{{Color|<color>|height=<optional>|width=<optional>|display=<optional>|roundy=<optional>}}
+
{{Color|<color>|height=<optional>|width=<optional>|display=<optional>|roundy=<optional>|small=<optional>}}
 
</pre>
 
</pre>
Creates a div with a background of a given color, with a color name centered inside. If no value is entered, default color is used and box displays 'Unknown'.
+
Creates a div with a background of a given color, with a color name centered inside. If no value is entered, default color is used and box displays 'Unknown'. Setting any value for <code>small</code> will result in the colored box being placed to the left of the text rather than enveloping it.
  
 
{| style="border-collapse:collapse;"
 
{| style="border-collapse:collapse;"

Revision as of 18:36, April 17, 2020

Unknown

Usage

{{Color|<color>|height=<optional>|width=<optional>|display=<optional>|roundy=<optional>|small=<optional>}}

Creates a div with a background of a given color, with a color name centered inside. If no value is entered, default color is used and box displays 'Unknown'. Setting any value for small will result in the colored box being placed to the left of the text rather than enveloping it.

 Supported Colors
Red
Green
Blue
Yellow
Orange
Pink
Purple
L. Blue
Beige
Brown
Gray
White
Colorful
Black
Default