Difference between revisions of "Template:Userbox"

From translatewiki.net
Jump to navigation Jump to search
(scalability only needed for the height)
 
(One intermediate revision by the same user not shown)
Line 25: Line 25:
 
| {{{logo-padding|}}} | {{#if: {{{id-p|}}} | {{{id-p|}}} | 1px }}
 
| {{{logo-padding|}}} | {{#if: {{{id-p|}}} | {{{id-p|}}} | 1px }}
 
}};height:{{#if: {{{logo-height|}}}
 
}};height:{{#if: {{{logo-height|}}}
| {{{logo-height|}}} | {{#if: {{{id-h|}}} | {{{id-h|}}} | 45 }}
+
| {{{logo-height|}}} | {{#if: {{{id-h|}}} | {{{id-h|}}} | 46 }}
 
}}px;width:{{#if: {{{logo-width|}}}
 
}}px;width:{{#if: {{{logo-width|}}}
 
| {{{logo-width|}}} | {{#if: {{{id-w|}}} | {{{id-w|}}} | 45 }}
 
| {{{logo-width|}}} | {{#if: {{{id-w|}}} | {{{id-w|}}} | 45 }}

Latest revision as of 17:49, 11 April 2021

id info
Test Template Info-Icon - Version (2).svg
The documentation of Userbox/doc this template is included from its /doc subpage (Edit)
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)
info-background 2, info-c optional (#EEE by default)
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)
style optional (empty by default)
Optional styles for the logo or id
logo-size 5, id-s optional (value in pt, 14 by default; 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; this is the line-height to render the text of the ID, not used with a graphic logo)
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)
logo-padding id-p optional (1pt by default)
logo-width id-w optional (value in px, 45 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 by default)
info-line-height info-lh optional (normal by default)
info-color info-fc optional (#000 by default)
info-padding info-p optional (4pt by default)
info-other-param info-op optional (empty by default)