Template:IconBox/doc: Difference between revisions

Vergir (talk | contribs)
Document the generic box split out of AbilityInteraction, including the data-attribute contract with Module:AbilitySection (with help from vergir-bot LLM)
 
Vergir (talk | contribs)
Update data attribute names after the iconbox- rename (with help from vergir-bot LLM)
Line 51: Line 51:
== Data attributes ==
== 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.
The box carries {{code|data-iconbox-icon}}, {{code|data-iconbox-title}}, and {{code|data-iconbox-state}} on its wrapper element. {{code|data-iconbox-state}} is one of {{code|normal}}, {{code|disabled}}, or {{code|partial}}.
 
[[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.
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.