Difference between revisions of "Template:Color strip"

From blackwiki
Jump to navigation Jump to search
imported>Frietjes
(add colour and outer-style)
imported>Frietjes
(optional)
Line 1: Line 1:
 
{{#if:{{{1|}}}
 
{{#if:{{{1|}}}
 
| <!-- if the first parameter exists, do work -->
 
| <!-- if the first parameter exists, do work -->
<span style="{{{outer-style|border:#aaa 1px solid}}}">{{
+
{{#if:{{{bordered|}}}|<span style="border:#aaa 1px solid">}}{{
 
   #if:{{{1|}}}
 
   #if:{{{1|}}}
 
   |<span style="background:{{{1|}}}; border:{{{border|0}}}px {{{border-style|solid}}} {{{border-color|{{{border-colour|#000}}}}}}; vertical-align:{{{align|center}}}; padding-right:{{#if:{{{w|}}}|{{{w|}}}|1}}em; padding-top:{{#if:{{{h|}}}|{{#expr:{{{h}}}/2.0 round 1}}|0}}ex; padding-bottom:{{#if:{{{h|}}}|{{#expr:{{{h}}}/2.0 round 1}}|0}}ex; line-height:{{#if:{{{h|}}}|{{#expr:{{{h}}}*100 round 0}}|100}}%">&nbsp;</span>
 
   |<span style="background:{{{1|}}}; border:{{{border|0}}}px {{{border-style|solid}}} {{{border-color|{{{border-colour|#000}}}}}}; vertical-align:{{{align|center}}}; padding-right:{{#if:{{{w|}}}|{{{w|}}}|1}}em; padding-top:{{#if:{{{h|}}}|{{#expr:{{{h}}}/2.0 round 1}}|0}}ex; padding-bottom:{{#if:{{{h|}}}|{{#expr:{{{h}}}/2.0 round 1}}|0}}ex; line-height:{{#if:{{{h|}}}|{{#expr:{{{h}}}*100 round 0}}|100}}%">&nbsp;</span>
Line 61: Line 61:
 
   #if:{{{20|}}}
 
   #if:{{{20|}}}
 
   |<span style="background:{{{20|}}}; border:{{{border|0}}}px {{{border-style|solid}}} {{{border-color|{{{border-colour|#000}}}}}}; vertical-align:{{{align|center}}}; padding-right:{{#if:{{{w|}}}|{{{w|}}}|1}}em; padding-top:{{#if:{{{h|}}}|{{#expr:{{{h}}}/2.0 round 1}}|0}}ex; padding-bottom:{{#if:{{{h|}}}|{{#expr:{{{h}}}/2.0 round 1}}|0}}ex; line-height:{{#if:{{{h|}}}|{{#expr:{{{h}}}*100 round 0}}|100}}%">&nbsp;</span>
 
   |<span style="background:{{{20|}}}; border:{{{border|0}}}px {{{border-style|solid}}} {{{border-color|{{{border-colour|#000}}}}}}; vertical-align:{{{align|center}}}; padding-right:{{#if:{{{w|}}}|{{{w|}}}|1}}em; padding-top:{{#if:{{{h|}}}|{{#expr:{{{h}}}/2.0 round 1}}|0}}ex; padding-bottom:{{#if:{{{h|}}}|{{#expr:{{{h}}}/2.0 round 1}}|0}}ex; line-height:{{#if:{{{h|}}}|{{#expr:{{{h}}}*100 round 0}}|100}}%">&nbsp;</span>
}}</span>
+
}}{{#if:{{{bordered|}}}|</span>}}
 
| <!-- if the first parameter does not exist, show syntax -->
 
| <!-- if the first parameter does not exist, show syntax -->
 
   <code><nowiki>{{color strip|color1|color2|...|color20}}</nowiki></code>
 
   <code><nowiki>{{color strip|color1|color2|...|color20}}</nowiki></code>

Revision as of 22:37, 14 March 2013

{{color strip|color1|color2|...|color20}}

Template documentation[view] [edit] [history] [purge]

This is the {{color strip}} template.

It creates a strip of up to twenty colors.

Usage

This template takes one or more parameters. The first twenty unnamed parameters are the names or color codes for the colors displayed in the resulting color strip.

Examples

Code to the left and actual rendering to the right:

{{color strip|red|green|blue}} =    
{{color strip|w=2|red|red|green|blue|green|red|red}} =        
{{color strip|align=top|border=1|border-color=black|border-style=solid|w=2|h=2|red|green|blue}} =    
{{color strip|align=top|border=2|border-color=black|border-style=dotted|w=5|h=5|red|green|blue}} =    

Options

  • w is the width in em units.
  • h is the height in ex units.
  • border is the border thickness in px units.
  • border-color is the border color.
  • border-style is the border style: none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset.
  • align is the vertical alignment: top, bottom, center.
  • frame is the frame thickness in px units.

See also