Template:Legend
Shows a legend row with a colored box.
Usage
{{legend|background-color|caption|outline=outline color|border=css border}}
- background-color is passed to the css background-color property of the color box.
- The optional outline parameter is the color of the outline around the box.
- The optional border argument which 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
Use in text
{{legend|black|Africa}}
{{legend|green|Americas}}
{{legend|blue|Oceania}}
{{legend|#ffa|Europe|outline=silver}}
{{legend|#ff2800|Asia|outline=#A2A9B1}} (#A2A9B1 is the wikitables border color.)
Markup | Renders as |
---|---|
[[File:Celts in Europe.png|upright=.9|thumb|right|The Celts in Europe, past and present: {{legend|#1a8000|Present-day Celtic-speaking areas}} {{legend|#27c600|Other parts of the six most commonly recognized "Celtic nations" and where a Celtic language is spoken but not the dominating language}} {{legend|#97ffb6|Other parts of Europe once peopled by Celts; modern-day inhabitants of many of these areas often claim a Celtic heritage and/or culture}} {{legend|#D2FFD2|Lusitanian area of Iberia, "Celticity" uncertain}} {{legend|yellow|The core Hallstatt territory, expansion before 500 BC}} ]] |
|
Full parameter list
{{legend | [legend box's colo(u)r] | [text following legend box] | outline = <!--colo(u)r of border around legend 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 legend box--> }}
TemplateData
This is the TemplateData documentation for this template used by VisualEditor and other tools.
Legend
<templatedata> { "params": { "1": { "label": { "en": "Color", "cs": "Barva" }, "description": { "en": "The color for the legend entry, in any CSS format", "cs": "Barva pro položku legendy v libovolném formátu CSS" }, "example": "\"#6D6E00\", \"#ffa\", \"yellow\"", "type": "line", "required": true }, "2": { "label": { "en": "Caption", "cs": "Titulek" }, "description": { "en": "Label for the legend entry", "cs": "Štítek pro záznam legendy" }, "example": { "en": "\"soda\" is most common", "cs": "\"soda\" je nejběžnější" }, "type": "string", "suggested": true }, "border": { "label": { "en": "CSS border style", "cs": "Styl ohraničení CSS" }, "description": { "en": "CSS style for the legend entry's border", "cs": "Styl CSS pro ohraničení položky legendy" }, "type": "string" }, "outline": { "label": { "en": "Entry outline", "cs": "Vstupní osnova" }, "description": { "en": "CSS color for the outline of the legend entry", "cs": "Barva CSS pro obrys položky legendy" }, "example": "silver", "type": "line" }, "text": { "label": { "en": "Text in the entry", "cs": "Text ve vstupu" }, "description": { "en": "Text to be displayed in the legend entry box, i.e. within the color specified", "cs": "Text, který se zobrazí ve vstupním poli legendy, tj. v zadané barvě" }, "example": "Af", "type": "line" }, "textcolor": { "label": { "en": "Text color", "cs": "Barva textu" }, "description": { "en": "CSS color of text inside the legend's colored box", "cs": "CSS barva textu uvnitř barevného rámečku legendy" }, "type": "string" }, "size": { "description": { "en": "Size of the legend entry", "cs": "Velikost položky legendy" }, "type": "string" } }, "description": { "en": "Shows a legend row with a colored box and a caption.", "cs": "Zobrazuje řádek legendy s barevným rámečkem a popiskem." } } </templatedata>