Template:Producer icon: Difference between revisions

From Corsair Cove Official Wiki
added parameters table
Swapped to use global css style class
Line 1: Line 1:
<includeonly><div style="position: relative; width: {{#switch: {{{size}}}|sm=32|md=64|lg=96|xl=128|#default=64}}px; height: {{#switch: {{{size}}}|sm=32|md=64|lg=96|xl=128|#default=64}}px; padding: 0; line-height: 0; font-size: 0;"><!--
<includeonly><!--
-->[[File:T ICO BuildingSign Shield.png|x{{#switch: {{{size}}}|sm=32|md=64|lg=96|xl=128|#default=64}}px|link=]]<!--
--><div {{#ifeq: {{{size|xs}}}|xs||class="cc-producer-icon"}}><!--
--><div style="position: absolute; top: 19%; left: 19%; width: 62%; height: 62%;"><!--
---->[[File:{{{1|}}}<!--
---->[[File:{{{1|}}}|x{{#switch: {{{size}}}|sm=20|md=40|lg=60|xl=80|#default=40}}px]]<!--
------>|x{{#switch: {{{size|xs}}}|xs=16|sm=20|md=40|lg=60|xl=80}}px<!--
--></div><!--
---->]]<!--
--></div></includeonly><noinclude>
--></div></includeonly><noinclude>


Layers the "Producers" icon shown in the Production Chains overview, a plain wooden shield background, behind the icon with the specified filename. Applies the specified size to the ''whole'' stack, so the inner icon will be smaller.
Layers the "Producers" icon shown in the Production Chains overview, a plain wooden shield background, behind the icon with the specified filename. Applies the specified size to the ''whole'' stack, so the inner icon will be slightly smaller.


== Usage ==
== Usage ==


Do not use this for displaying icons inline in a paragraph; it's too small. Just use the building name itself or rewrite to refer to the resource itself so you can use just the resource icon. Size <code>xs</code> is not supported by this template for this reason.
This skips the shield on extra-small sizes; this means with just the resource icon it could be confusing, so it is recommended to use just the building name itself or rewrite to refer to the resource itself so you can use just the resource icon clearly.


{|class=wikitable
{|class=wikitable
Line 17: Line 17:
| filename || specify the filename only, no ''File:'' namespace
| filename || specify the filename only, no ''File:'' namespace
|-
|-
| <code>size=</code> || choose the size, from small to extra large:
{{Parameter standardized sizes}}
* <code>sm</code>
* <code>md</code>
* <code>lg</code>
* <code>xl</code>
|}
|}


=== Examples ===
=== Examples ===
<pre>{{Producer icon|T ICO resource Hardwood.png}}</pre>
{{Producer icon|T ICO resource Hardwood.png}}


<pre>{{Producer icon|T ICO resource Hardwood.png|size=sm}}</pre>
<pre>{{Producer icon|T ICO resource Hardwood.png|size=sm}}</pre>
Line 43: Line 42:
! Icon !! Name
! Icon !! Name
|-
|-
| {{Producer icon|T ICO resource Hardwood.png|size=lg}} || small
| {{Producer icon|T ICO resource Hardwood.png}} || extra small
|-
|-
| {{Producer icon|T ICO resource Hardwood.png|size=lg}} || medium
| {{Producer icon|T ICO resource Hardwood.png|size=sm}} || small
|-
| {{Producer icon|T ICO resource Hardwood.png|size=md}} || medium
|-
|-
| {{Producer icon|T ICO resource Hardwood.png|size=lg}} || large
| {{Producer icon|T ICO resource Hardwood.png|size=lg}} || large
Line 53: Line 54:
{|class=wikitable
{|class=wikitable
! Icon !! Name
! Icon !! Name
|-
| {{Producer icon|T ICO resource Hardwood.png}} || extra small
|-
|-
| {{Producer icon|T ICO resource Hardwood.png|size=sm}} || small
| {{Producer icon|T ICO resource Hardwood.png|size=sm}} || small

Revision as of 17:31, 1 August 2026


Layers the "Producers" icon shown in the Production Chains overview, a plain wooden shield background, behind the icon with the specified filename. Applies the specified size to the whole stack, so the inner icon will be slightly smaller.

Usage

This skips the shield on extra-small sizes; this means with just the resource icon it could be confusing, so it is recommended to use just the building name itself or rewrite to refer to the resource itself so you can use just the resource icon clearly.

Parameter Purpose
filename specify the filename only, no File: namespace
size= the size of the icon, or omit for an extra small default size appropriate for inline in paragraphs:
  • xs - default
  • sm
  • md
  • lg
  • xl

Examples

{{Producer icon|T ICO resource Hardwood.png}}
{{Producer icon|T ICO resource Hardwood.png|size=sm}}
{{Producer icon|T ICO resource Hardwood.png|size=md}}
{{Producer icon|T ICO resource Hardwood.png|size=lg}}
{{Producer icon|T ICO resource Hardwood.png|size=xl}}


And in table cells:

{|class=wikitable
! Icon !! Name
|-
| {{Producer icon|T ICO resource Hardwood.png}} || extra small
|-
| {{Producer icon|T ICO resource Hardwood.png|size=sm}} || small
|-
| {{Producer icon|T ICO resource Hardwood.png|size=md}} || medium
|-
| {{Producer icon|T ICO resource Hardwood.png|size=lg}} || large
|-
| {{Producer icon|T ICO resource Hardwood.png|size=xl}} || extra-large
|}
Icon Name
extra small
small
medium
large
extra-large