Template:Color-sample: Difference between revisions
Appearance
inline version of Template:Legend without following text |
m 1 revision imported: Initial Setup |
||
(No difference)
| |||
Latest revision as of 14:12, 6 April 2026
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.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Color | 1 | The color for the sample box, in any CSS format.
| Line | required |
| CSS border style | border | CSS style for the sample box's border. | String | optional |
| Entry outline | outline | CSS color for the outline of the sample box.
| Line | optional |
| Text in the entry | text | Text to be displayed in the sample box, i.e. within the color specified.
| Line | optional |
| Text color | textcolor | CSS color of text inside the legend's colored box. | String | optional |
| Size | size | Size of the sample box. | String | optional |