Template:IconLink: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
No edit summary
Tag: Reverted
(Undo revision 27630 by Taylan (talk))
Tags: Undo Reverted
Line 3: Line 3:
{{#vardefine: max-w | {{{w|}}} }}
{{#vardefine: max-w | {{{w|}}} }}
{{#vardefine: max-h | {{{h | {{{size | 40}}} }}} }}
{{#vardefine: max-h | {{{h | {{{size | 40}}} }}} }}
}}<span style="display: inline-flex; align-items: center;"><span style="display: inline-flex; align-items: center; justify-content: center; min-width: {{#var:min-w}}px; height: {{#var:max-h}}px;">[[File:{{{1}}}|frameless|link={{{2}}}|{{#var:max-w}}x{{#var:max-h}}px|{{{2}}}]]</span>&nbsp;[[ {{{2}}} |{{{ 3 |{{{ 2 }}} }}} ]]</span></includeonly><noinclude>
}}<div style="display: inline-flex; align-items: center;"><div style="display: inline-flex; align-items: center; justify-content: center; min-width: {{#var:min-w}}px; height: {{#var:max-h}}px;">[[File:{{{1}}}|frameless|link={{{2}}}|{{#var:max-w}}x{{#var:max-h}}px|{{{2}}}]]</div>&nbsp;[[ {{{2}}} |{{{ 3 |{{{ 2 }}} }}} ]]</div></includeonly><noinclude>
Usage: {{code|<nowiki>{{IconLink|Flourish Icon.png|Flourish}}</nowiki>}}
Usage: {{code|<nowiki>{{IconLink|Flourish Icon.png|Flourish}}</nowiki>}}



Revision as of 16:22, 10 August 2023

Usage: {{IconLink|Flourish Icon.png|Flourish}}

Result:
Flourish
 Flourish

The link text can be changed with a third parameter:

Usage: {{IconLink|Flourish Icon.png|Flourish|Custom Text}}

Result:
Flourish
 Custom Text

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.

An alternative value for the height can be provided via the size or h parameters, which are synonyms:

Usage: {{IconLink|size=25|Flourish Icon.png|Flourish}}

Result:
Flourish
 Flourish

Usage: {{IconLink|size=25|Flourish Icon.png|Flourish|Custom Text}}

Result:
Flourish
 Custom Text

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 this table shown on our main page as of the writing of this documentation:

Rolls
The roll you make to determine whether an attack hits an enemy at all.
The roll you make to determine the amount of damage done by a successful attack.
The roll you make to attempt avoiding various threats other than direct attacks.
The roll you make when attempting anything else that requires a roll to succeed.
Modifiers
Roll the die twice, and use the higher result. Disadvantage is the exact opposite.
The number you add to your rolls based on your Ability Scores.
The number you add to your rolls based on whether you have Proficiency.