Jump to content

Template:Color-sample/doc

From wikiNonStop
Revision as of 14:12, 6 April 2026 by Majestix (talk | contribs) (1 revision imported: Initial Setup)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Shows a color sample box for inline use without accompanying text.

Usage

{{color-sample|background-color|outline=outline color|border=css border}}
  • background-color is passed to the css background-color property of the sample box.
  • The optional outline parameter is the color of the outline around the box.
  • The optional border argument overrides the outline argument and sets the css description (e.g., 1px solid #aaa) of the border that will be drawn around the box.

Examples

  • {{color-sample|black}} →  
  • {{color-sample|green}} →  
  • {{color-sample|blue}} →  
  • {{color-sample|#ffa|outline=silver}} →  
  • {{color-sample|#ff2800|outline=#A2A9B1}} →  

Full parameter list

{{color-example
| [box's colo(u)r]
| outline =  <!--colo(u)r of border around box-->
| border =   <!--use to specify custom CSS styling for border (overrides 'outline')-->
| color =    <!--colo(u)r of 'text'-->
| size =     <!--'text' font-size-->
| text =     <!--to place text inside the box-->
}}

See also

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools.

Color-sample

Shows a color sample box without accompanying text.

Template parameters

ParameterDescriptionTypeStatus
Color1

The color for the sample box, in any CSS format.

Example
"#6D6E00", "#ffa", "yellow"
Linerequired
CSS border styleborder

CSS style for the sample box's border.

Stringoptional
Entry outlineoutline

CSS color for the outline of the sample box.

Example
silver
Lineoptional
Text in the entrytext

Text to be displayed in the sample box, i.e. within the color specified.

Example
Af
Lineoptional
Text colortextcolor

CSS color of text inside the legend's colored box.

Stringoptional
Sizesize

Size of the sample box.

Stringoptional