Editing Template:IconBox/doc

Warning: You are not logged in. Once you make an edit, a temporary account will be created for you. Learn more. Log in or create an account to continue receiving notifications after this account expires, and to access other features.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
== Usage ==
== Usage ==


{{tl|IconBox}} displays a box with a colored header, an icon, and a body of text.
{{tl|IconBox}} displays a box with a colored header, an icon, and a body of text. It carries no meaning of its own — every part of its appearance is supplied by the caller.


Used by {{tl|AbilityInteraction}}.
For standard ability interactions, use {{tl|AbilityInteraction}} instead. It picks the header, color, icon, and link from a registry, so a given mechanic looks the same on every page. IconBox is for one-off boxes the registry does not cover.


== Parameters ==
== Parameters ==
Line 9: Line 9:
<templatedata>
<templatedata>
{
{
"description": "",
"description": "A box with a colored header, an icon, and body text. Presentation is supplied entirely by the caller.",
"params": {
"params": {
"title": {
"title": {
Line 39: Line 39:
},
},
"state": {
"state": {
"description": "Set to disabled to gray out the icon, partial to gray out half of it, or enhanced to add a blue glow.",
"description": "Set to disabled to gray out the icon, or partial to gray out half of it.",
"type": "string",
"type": "string",
"suggestedvalues": [ "disabled", "partial", "enhanced" ]
"suggestedvalues": [ "disabled", "partial" ]
}
}
},
},
Line 48: Line 48:
}
}
</templatedata>
</templatedata>
== Data attributes ==
The box carries {{code|data-ai-icon}}, {{code|data-ai-title}}, and {{code|data-ai-state}} on its wrapper element. [[Module:AbilitySection]] reads these to build the hint icons shown beside an ability card, and to link each one to its box.
These attributes are a contract with that module. The CSS class names are '''not''' — they are presentational and may change. Any code that needs to find these boxes should match on the data attributes.


== Examples ==
== Examples ==
Line 67: Line 73:
| text    = This ability benefits from Melee damage bonuses.
| text    = This ability benefits from Melee damage bonuses.
}}
}}
== Data attributes ==
The box carries several data attributes:
* {{code|data-iconbox-icon}},
* {{code|data-iconbox-title}},
* {{code|data-iconbox-state}} on its wrapper element.
These are used by [[Module:AbilitySection]] to apply correct styling to its own elements.


<noinclude>[[Category:Template documentation]]</noinclude>
<noinclude>[[Category:Template documentation]]</noinclude>
Please note that all contributions to The Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see Deadlock:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template