Template:ColorRect

Template documentation[view · edit · history · purge]
This documentation is transcluded from Template:ColorRect/doc.


This template {{ColorRect}} creates an inline rectangle (in the text flow) filled with a color of choice, optionally specifying width and/or height parameters. The default color is lightgray (#CCC). The default size is 34 × 23 px.

This template doesn't draw any border around the rectangle.


Usage

To produce an inline colored rectangle, call this template with:

  • three numbered parameters,
{{ColorRect |1= |2= |3= }},
  • three named parameters.
{{ColorRect |color= |width= |height= }},
  • three unnamed positional parameters
{{ColorRect |colorValue(@1st position) |widthValue(@2nd position) |heightValue(@3rd position) }},
  • or a mix of them.

When omitting some of them, parameters are defaulting to:

  • 1= color= lightgray (#CCCCCC, i.e. #CCC),
  • 2= width= 34px,
  • 3= heigth= 23px.

Then, when all three are missing, invoking {{ColorRect}} is equivalent to invoke {{ColorRect |#CCC |34px |23px }}.

TBD: transfer this text in Examples section

For example:

  • {{ColorRect}}
    
produces inline: Category:Colorbox formatting templates#rectangle (default three values: color=#CCC, width=34px, height=23px).
  • {{ColorRect|blue|10px|20px}}
    
produces inline: Category:Colorbox formatting templates#rectangle (usage with three unnamed parameters).
  • {{ColorRect|ltgreen}}
    
produces inline: Category:Colorbox formatting templates#rectangle (usage with one parameter – color –; default size parameters – 34×23px).
  • {{ColorRect|#E8D400|4em|3px}}
    
produces inline: Category:Colorbox formatting templates#rectangle (usage with three unnamed parameters; hexa specified color, mixed units size parameters).
  • {{ColorRect|#ECA|height=5px}}
    
produces inline: Category:Colorbox formatting templates#rectangle (usage with one named parameter: height; hexa specified color @1st position, no parameter 'width=' or '2=': width is considered at its default value: 34px).

Parameters

to be continued

Examples

to be continued


Localization

This template is not intended to be localized.

See also

  • {{Cbox}}, a fixed sized inline colored square.
  • {{Color}}, a generalized form of {{Cbox}}; with more parameters, including text .
  • {{ColorBox}}, a fixed sized inline colored square. Or, with optional text, a rectangle adjusted to text content, font-size and line-height.
    • {{Colorbox}}, seems to be an extended version of {{ColorBox}}, with an optional tooltip.
  • {{ColorSample}}, a fixed sized inline color rectangle (almost a square), with a black gray border, and an optional text.
    • {{Colorsample}}, a fixed sized inline color square, with a grey border, and a tooltip displaying the given background color.

Color swatches implying new paragraph

To be defined

Category:Colorbox formatting templates#rectangle
Category:Colorbox formatting templates