Difference between revisions of "Template:Legend-line"
Jump to navigation
Jump to search
imported>Nihiltres (Restructured template: outer element gets class="legend", inner line gets class="legend-line", plus laid out with (commented) linebreaks) |
imported>Nihiltres (Updated from sandbox; adds TemplateStyles from Template:Legend/styles.css) |
||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
− | --> | + | --><templatestyles src="Legend/styles.css" /><!--"main" stylesheet for legends--><!-- |
-->{{#ifeq:{{{inline|}}}|yes|<span class="legend" style="padding-right:5px;">|<div class="legend">}}<!-- | -->{{#ifeq:{{{inline|}}}|yes|<span class="legend" style="padding-right:5px;">|<div class="legend">}}<!-- | ||
− | --><span class="legend-line" style="display:inline-block; vertical-align:middle; width:1.67em; height: | + | --><span class="legend-line" <!-- below could be bundled into a template-specific TemplateStyles CSS sheet |
− | -->{{#if:{{{1|}}}|border-top:{{{1}}};}} | + | -->style="display: inline-block; vertical-align: middle; width: 1.67em; height: 0; border-style: none; border-top: 2px dotted black;<!-- |
− | + | -->{{#if:{{{1|}}}| border-top:{{{1}}};|}}"> </span><!-- | |
+ | --> {{{2|}}}<!-- | ||
-->{{#ifeq:{{{inline|}}}|yes|</span>|</div>}}<!-- | -->{{#ifeq:{{{inline|}}}|yes|</span>|</div>}}<!-- | ||
--></includeonly><noinclude>{{documentation}}</noinclude> | --></includeonly><noinclude>{{documentation}}</noinclude> |
Latest revision as of 16:48, 30 September 2020
Script error: No such module "Uses TemplateStyles".
Usage
Shows a legend row with a colored line.
- Example
Borders in 1914
Borders in 1920
{{legend-line|black solid 2px|Borders in 1914}} {{legend-line|red dotted 2px|Borders in 1920}}
Inline: Borders in 1914 Borders in 1920
{{legend-line|black solid 2px|Borders in 1914|inline=yes}} {{legend-line|red dotted 2px|Borders in 1920|inline=yes}}
- Usage
{{legend-line|line type|label}}
line type is passed to the css border property, and can include properties like solid
, dotted
, dashed
, double
, etc.
See also
TemplateData
This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.
TemplateData for Legend-line
Shows a legend entry with a styled line (including color)
Parameter | Description | Type | Status | |
---|---|---|---|---|
CSS style | 1 | The CSS style for the legend entry
| String | required |
Caption | 2 | Text displayed in the entry, next to the line style
| Line | required |
inline? | inline | If 'yes', suppresses new line/line feed
| String | optional |
The above documentation is transcluded from Template:Legend-line/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |