From Brotato Wiki
(Add more comments to improve readability; Remove max-width (as it causes some issues eg. with element overflow, and can stop text from being centered correctly with long words eg "Wheelbarrow"); Add <br> (to ensure line breaks happen, and fix issues where the line break wasn't occurring despite max-width) with an option to hide it (`nobr=1`)) |
(Add back support for max-width -- mainly done to set max-width:auto, which fixes issues when using the `nobr` option) |
||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
--><div class="iconbox" style="display:inline-block;"><!-- | --><div class="iconbox" style="display:inline-block;{{#if:{{{maxwidth}}}|max-width:{{{maxwidth}}}|max-width:initial;}}"><!-- | ||
ICON | ICON | ||
--><div class="rarity{{{rarity|{{Rarity|{{{1}}}}}}}} rounded relative"><!-- | --><div class="rarity{{{rarity|{{Rarity|{{{1}}}}}}}} rounded relative"><!-- | ||
Line 70: | Line 70: | ||
|} | |} | ||
=== Other Options === | |||
The <code>maxwidth</code> option lets you restrain text that would otherwise be very long: | |||
<code><nowiki>{{Iconbox|Acid|size=60px|top=This text is quite long but maxwidth restrains it|maxwidth=120px}}</nowiki></code> | |||
{{Iconbox|Acid|size=60px|top=This text is quite long but maxwidth restrains it|maxwidth=120px}} | |||
</noinclude> | </noinclude> |
Revision as of 22:05, 6 November 2022
Usage
This template can be used by entering the following onto a relevant page. Do not use this on your user page. It is reserved for content pages.
{{Iconbox|Acid|size=30px|caption=caption|amount=1|rarity=1}}
Examples
Code | Preview |
---|---|
{{Iconbox|Acid}}
|
|
{{Iconbox|Acid|amount=1}}
|
|
{{Iconbox|Acid|caption=Foobar}}
|
|
{{Iconbox|Acid|caption=no}}
|
|
{{Iconbox|Acid|top=Foobar}}
|
|
{{Iconbox|Acid|rarity=-1}}
|
|
{{Iconbox|Acid|size=30px}}
|
|
{{Iconbox|Acid|size=30px|nobr=1}}
|
|
{{Iconbox|Acid|size=30px|nobr=1|top=Foobar}}
|
Foobar Acid
|
Other Options
The maxwidth
option lets you restrain text that would otherwise be very long:
{{Iconbox|Acid|size=60px|top=This text is quite long but maxwidth restrains it|maxwidth=120px}}