Template:Icon text

From bg3.wiki
(Redirected from Template:IconText)
Jump to navigation Jump to search
Template documentation

Displays an icon with text.

Usage

The default size is x40px meaning the icon is scaled until the height is 40 px. It's usually important to limit the height since the icons are used inline, and a very high inline image makes for an unpleasant text layout.

Icon Size

The width can be set via the w parameter. This could be useful if several elements are supposed to align vertically for design purposes, such as in the "D&D 5th edition rules" table on the desktop Main Page. This also uses the block and gap parameters. See Template:MainPageDesktop for source.

Blocks

Setting block to yes ensures that if the text part has to break into multiple lines, the second line doesn't flow under the icon and instead the text is constrained into a rectangular block. The gap parameter can only be provided if block is set to yes, and determines the gap (in px) between the icon and the aforementioned rectangular text block.

Examples

Example Markup Renders as
Default
{{icon text | Flourish Icon.png | Flourish }}
Flourish Flourish
With link
{{icon text | Flourish Icon.png | Custom Text | link = Flourish }}
Custom Text Custom Text
Adjusting size & font size
{{icon text | size = 25 | font size = 80% | Flourish Icon.png | Flourish }}
Flourish Flourish
With size, font size, and link
{{icon text | size = 25 | font size = 80% | Flourish Icon.png | Custom Text | link = Flourish }}
Custom Text Custom Text
Missing icon
{{icon text | Missing Icon 123.png | Flourish | size = 30 }}
File:Missing Icon 123.png Flourish

No description.

Template parameters

ParameterDescriptionTypeStatus
Icon1

File to use for the icon, without File: prefix.

Example
Blah blub.webp
Filerequired
Text2

Text to show next to the icon.

Example
Blah blub
Contentrequired
Linklink

Optional link, for both icon and text.

Page nameoptional
Widthw

Exact width of icon.

Numberoptional
Sizesize

Preferred size of icon.

Numberoptional
Heighth

Maximum height of icon.

Numberoptional
Blockblock

Whether to wrap the icon and text in a containing HTML element and use 'inline-flex' to align the icon and text.

Stringoptional
Gapgap

If 'block' is set, the exact gap to use between the icon and text.

Numberoptional
Nowrapnowrap

Whether to use white-space: nowrap; to prevent line breaks.

Stringoptional
Classclass

CSS class to add to the icon.

Stringoptional
Separatorseparator

What to put between the icon and text. Default is an NBSP.

Contentoptional
Font sizefont size

Font size to use for text.

Numberoptional