Difference between revisions of "Template:Legend inline"
Jump to navigation
Jump to search
imported>Nihiltres (Removed font-size on legend-text: migrated into TemplateStyles sheet) |
imported>Nihiltres (Copied improvements I made to Template:Legend, mainly the automatic color contrast optimization) |
||
Line 1: | Line 1: | ||
− | <includeonly><templatestyles src="Legend/styles.css" /><span class="legend"><span class="legend-color" style="<!-- | + | <includeonly><!-- |
+ | --><templatestyles src="Legend/styles.css" /><!-- | ||
+ | --><span class="legend"><span class="legend-color" style="<!-- | ||
-->{{#if:{{{border|}}}|border: {{{border}}};|{{#if:{{{outline|}}}|border: 1px solid {{{outline}}};}}}} <!-- | -->{{#if:{{{border|}}}|border: {{{border}}};|{{#if:{{{outline|}}}|border: 1px solid {{{outline}}};}}}} <!-- | ||
− | -->{{#if:{{{1|}}}| | + | -->{{#if:{{{1|}}}|{{greater color contrast ratio|{{{1}}}|white|black|css=y}}}}<!-- |
-->{{#if:{{{textcolor|}}}|color:{{{textcolor}}};}} <!-- | -->{{#if:{{{textcolor|}}}|color:{{{textcolor}}};}} <!-- | ||
-->{{#if:{{{size|}}}|font-size:{{{size}}};}}<!-- | -->{{#if:{{{size|}}}|font-size:{{{size}}};}}<!-- | ||
− | -->">{{#if:{{{text|}}}|<span class="legend-text">{{{text}}}</span>| }}</span> {{{2|}}}</span></includeonly><noinclude> | + | -->">{{#if:{{{text|}}}|<span class="legend-text">{{{text}}}</span>| }}</span><!-- |
− | {{documentation}} | + | --> {{{2|}}}</span><!-- |
− | </noinclude> | + | --></includeonly><noinclude>{{documentation}}</noinclude> |
Revision as of 21:52, 31 August 2020
Script error: No such module "Uses TemplateStyles".
Description
- Shows a legend with a coloured box.
- This template differs from Template:Legend only in that it uses display:inline to prevent line breaks after each legend.
Usage
See Template:Legend/doc for usage.
See also
- For the original version of this template using display:block, see {{Legend}}
- For legend rows representing lines, see {{legend-line}}
The above documentation is transcluded from Template:Legend inline/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. |