Template:Userbox/doc

From translatewiki.net
This is the documentation subpage for the parent Template:Userbox page.
Usage
Useful userbox template.
Basic syntax
  • {{Userbox|logo background color|info background color|logo or short id|info text}}
  • {{Userbox|
    border-c = border background color |
    id-c = logo background color |
    info-c = info background color |
    id = logo or short id |
    info = info text }}
Parameters
Alternate parameters are those using shorter names, or using the legacy positional (numbered) parameters. They are tested and used only if they are not empty, in the indicated order always after the long parameter name tested first. Otherwise the default value in the description is used.
Note that the legacy parameter 1 can be used to select the same color for the logo or id background and the for outer border of the box.
Parameter Alternate parameters Description and default value
Basic parameters
logo-background 1, id-c optional (#DDD by default; this background color for the logo or ID cell on the right may be slightly more vivid than the info cell, or should be very light otherwise)
info-background 2, info-c optional (#EEE by default; this background colorfor the info text on the left may be slightly lighter than the logo or ID cell, or may be slightly more vivid otherwise)
logo 3, id mandatory (displays "id" otherwise)
info 4 mandatory (displays "info" otherwise)
Optional styles for the outer box
float optional (left by default)
border-width border-s optional (value in px, 1 by default)
border-color border-c, 1 optional (#CCC by default; this color should offer a smooth an greyish transition from the clear background of the page and background colors of the logo/ID cell or info cell)
style optional (empty by default)
Optional styles for the logo or id
logo-size 5, id-s optional (value in pt, 13.5 by default, i.e. 18px; this is the font size for showing the ID, not used with a graphic logo)
logo-line-height id-lh optional (1.25 by default in em, i.e. 17.25pt=23px with the default logo-size=13.5pt=18px; this is the line-height to render the text of the ID, not used with a graphic logo; this short line-height, suitable for basic Latin, allows the ID to wrap on 2 lines and still fit in the default cell height of 46px for the logo or ID, as set below by logo-height)
logo-color id-fc optional (#000 by default; this is the foreground color to render the text of the ID, not used with a graphic logo; it should sufficiently contrasted with the logo-background color)
logo-padding id-p optional (1px by default; note that this sets both a horizontal and vertical minimal padding, to avoid the logo or ID to touch the borders of the box, or the info cell to its right)
logo-width id-w optional (value in px, 46 by default; this is a minimum value, the ID may extend this width if it does not fit at the given font size)
logo-height id-h optional (value in px, 46 by default; should be even for correct scaling with Hi-DPI displays or zooms)
logo-other-param id-op optional (empty by default) for the container box
id-style optional (empty by default) for the id or logo span
Optional styles for the info part
info-size info-s optional (value in pt, 8.25 by default, i.e. 11px)
info-line-height info-lh optional (16px by default, i.e 12pt, or ~1.455em with the default info-size=8.25pt=11px; this line-height, suitable for most scripts, allows the info to wrap on 3 lines and still fit in the default cell height of 46px for the logo or ID as set above by logo-height)
info-color info-fc optional (#000 by default; it should be sufficiently contrasted with the info-background color; note that when the info text contains any link, the text to display for the link should use an inner span element styled with a suitable color, having a good contrast with the info-background color for readability, and slighyly vivified or emphasized compared to this info color used for the unlinked text; for example when the info-background is blue, red or dark, a suitable link color may be yellow, while the rest of the text may be white, otherwise the info color should be black on a light background, with text of links set to blue by default)
info-padding info-p optional (0 1px by default; note that this sets only a minimal horizontal padding to avoid the info text to touch the ID or logo cell to the left, or the right border of the box, because any text in info should not touch or collide with top and bottom borders of the box, thanks to its line-height)
info-other-param info-op optional (empty by default)
See also: