Template talk:Legtab/doc

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Legtab expansions

[edit]

To enable the abbreviating use of ((T|Legtab}}, which allows only two parameters, workarounds had been invented to allow

  • Legend-lines (or empty legends with the line= parameter)
  • bordered boxes (legends with the border= parameter)
  • striped boxes (legends with the stripe= parameter)
  • lined boxes (legends with the line= parameter)


For these expansions a more complicated parameter 1, normally the box color, can be interpreted.
Stripes performed with a file from SVG stripe texture overlays are rather easy:
a box color as e.g. #F00 expanded by a 2-char-prefix B)#F00 will be striped by the file SVGstripesB.svg

Border definitions (for lines and borders) are bit more complicated. Borders are defined with the three values border-color, border-width and border-style, in any sequence:

  • border-color can be expressed by any valid color definition
  • border-width expresses the line width with any measurement, preferable e.g. "2px".
  • border-style can be solid, dotted, dashed, double, groove, ridge, inset, outset, hidden, none.

It had been thought but not performed to allow abbreviations and defaults for width and style.

It is easy to differ between the defined borders: parameter 1 containing no space is just a color code, eventually striped;
with two spaces it is only a "line"; with three spaces it's a bordered color box (sequence:color border);
and with four spaces it's a color box containing a line (sequence:color  line, with two spaces after color).