Template:IconText: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
Use template demo
mNo edit summary
 
Line 54: Line 54:
| <nowiki>{{IconText | Missing Icon 123.png | Flourish | size = 30 }}</nowiki>
| <nowiki>{{IconText | Missing Icon 123.png | Flourish | size = 30 }}</nowiki>
}}
}}
=== Complete example ===
{| class="wikitable" style="width: 50%;"
! colspan="2" | Rolls
|-
| {{IconText | block = yes | w = 22 | h = 22 | gap = 2 | D20.png | Attack Roll }}
| The roll you make to determine whether an attack hits an enemy at all.
|-
| {{IconText | block = yes | w = 22 | h = 22 | gap = 2 | D6 Thunder.png | Damage Roll }}
| The roll you make to determine the amount of damage done by a successful attack.
|-
| {{IconText | block = yes | w = 22 | h = 22 | gap = 2 | Saving Throw Icon.png | Saving Throw }}
| The roll you make to attempt avoiding various threats other than direct attacks.
|-
| {{IconText | block = yes | w = 22 | h = 22 | gap = 2 | D20.png | Ability Check }}
| The roll you make when attempting anything else that requires a roll to succeed.
|-
! colspan="2" | Modifiers
|-
| {{IconText | block = yes | w = 22 | h = 22 | gap = 2 | Advantage_Icon.png | Advantage }}
| Roll the die twice, and use the higher result. [[Disadvantage]] is the exact opposite.
|-
| {{IconText | block = yes | w = 22 | h = 22 | gap = 2 | Charisma Ability Icon.png | Ability Score Modifier }}
| The number you add to your rolls based on your [[Ability Scores]].
|-
| {{IconText | block = yes | w = 22 | h = 22 | gap = 2 | Proficiency Icon.png | Proficiency Bonus }}
| The number you add to your rolls based on whether you have [[Proficiency]].
|}


}}
}}

Latest revision as of 12:23, 19 January 2025

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 following table shown on our main page as of the writing of this documentation. This also uses the block and gap parameters. (View the source of this page for usage.)

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
{{IconText | Flourish Icon.png | Flourish }}
Flourish Flourish
With link
{{IconText | Flourish Icon.png | Custom Text | link = Flourish }}
Custom Text Custom Text
Adjusting size
{{IconText | size = 25 | Flourish Icon.png | Flourish }}
Flourish Flourish
With size and link
{{IconText | size = 25 | Flourish Icon.png | Custom Text | link = Flourish }}
Custom Text Custom Text
Missing icon
{{IconText | Missing Icon 123.png | Flourish | size = 30 }}
Flourish Flourish