Jump to content
Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Resource: Difference between revisions

Template page
m Create Template:Resource for reusable resource chips
m Create Template:Resource for reusable resource chips
 
Line 1: Line 1:
<includeonly>{{#ifeq:{{{theme|dark}}}|light
<includeonly><templatestyles src="Template:Resource/styles.css" />{{#ifeq:{{{theme|dark}}}|light
|<span style="display:inline-flex;align-items:flex-start;gap:.25em;max-width:100%;background:#fff;border:1px solid #e0d8c3;border-radius:10px;color:#2b2620;padding:.2em .6em;font-size:.8em;line-height:1.4;white-space:normal;overflow-wrap:break-word;"><span style="display:inline-flex;flex-shrink:0;gap:.15em;">{{#if:{{{icon1|}}}|[[File:{{{icon1}}}|16x16px|link=]]}}{{#if:{{{icon2|}}}|[[File:{{{icon2}}}|16x16px|link=]]}}{{#if:{{{icon3|}}}|[[File:{{{icon3}}}|16x16px|link=]]}}</span><span style="flex:1 1 auto;min-width:0;">{{{term}}}</span></span>
|<span class="loka-resource-chip loka-resource-chip--light"><span class="loka-resource-icons">{{#if:{{{icon1|}}}|[[File:{{{icon1}}}|16x16px|link=]]}}{{#if:{{{icon2|}}}|[[File:{{{icon2}}}|16x16px|link=]]}}{{#if:{{{icon3|}}}|[[File:{{{icon3}}}|16x16px|link=]]}}</span><span class="loka-resource-text">{{{term}}}</span></span>
|<span style="display:inline-flex;align-items:flex-start;gap:.25em;max-width:100%;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.35);border-radius:10px;color:#ffffff;padding:.2em .6em;font-size:.8em;line-height:1.4;white-space:normal;overflow-wrap:break-word;"><span style="display:inline-flex;flex-shrink:0;gap:.15em;">{{#if:{{{icon1|}}}|[[File:{{{icon1}}}|16x16px|link=]]}}{{#if:{{{icon2|}}}|[[File:{{{icon2}}}|16x16px|link=]]}}{{#if:{{{icon3|}}}|[[File:{{{icon3}}}|16x16px|link=]]}}</span><span style="flex:1 1 auto;min-width:0;">{{{term}}}</span></span>
|<span class="loka-resource-chip loka-resource-chip--dark"><span class="loka-resource-icons">{{#if:{{{icon1|}}}|[[File:{{{icon1}}}|16x16px|link=]]}}{{#if:{{{icon2|}}}|[[File:{{{icon2}}}|16x16px|link=]]}}{{#if:{{{icon3|}}}|[[File:{{{icon3}}}|16x16px|link=]]}}</span><span class="loka-resource-text">{{{term}}}</span></span>
}}</includeonly><noinclude>
}}</includeonly><noinclude>
== Usage ==
== Usage ==
Line 7: Line 7:
<pre>
<pre>
{{Resource
{{Resource
|term=Apples
|term=Apple
|icon1=Apple.png
|icon1=Apple.png
|theme=dark
|theme=dark
Line 13: Line 13:
</pre>
</pre>


Renders a single pill-shaped resource chip, for use inside [[Template:Biome]]'s <code>protected</code>/<code>other</code> parameters (or anywhere else a small icon-tagged resource label is useful).
Renders a single pill-shaped resource chip, for use inside [[Template:Biome]]'s <code>protected</code>/<code>other</code> parameters (or anywhere else a small icon-tagged resource label is useful). Styling lives in [[Template:Resource/styles.css]].


Only <code>term</code> is required. Up to three icons can be shown (some resources cover multiple items, e.g. "Mushroom Blocks (Red/Brown/Stem)"). <code>theme</code> selects the pill's colour scheme to match its surroundings.
Only <code>term</code> is required. Up to three icons can be shown (some resources cover multiple items, e.g. "Mushroom Block (Red/Brown/Stem)"). <code>theme</code> selects the pill's colour scheme to match its surroundings.


== Parameters ==
== Parameters ==
Line 27: Line 27:
|-
|-
| <code>icon1</code> / <code>icon2</code> / <code>icon3</code>
| <code>icon1</code> / <code>icon2</code> / <code>icon3</code>
| Filenames (no <code>File:</code> prefix) of up to three 16px icons shown before the text.
| Filenames (no <code>File:</code> prefix) of up to three icons shown before the text, capped to a 16x16 box.
|-
|-
| <code>theme</code>
| <code>theme</code>

Latest revision as of 19:07, 17 August 2026

Usage

{{Resource
|term=Apple
|icon1=Apple.png
|theme=dark
}}

Renders a single pill-shaped resource chip, for use inside Template:Biome's protected/other parameters (or anywhere else a small icon-tagged resource label is useful). Styling lives in Template:Resource/styles.css.

Only term is required. Up to three icons can be shown (some resources cover multiple items, e.g. "Mushroom Block (Red/Brown/Stem)"). theme selects the pill's colour scheme to match its surroundings.

Parameters

Parameter Description
term The resource's display text.
icon1 / icon2 / icon3 Filenames (no File: prefix) of up to three icons shown before the text, capped to a 16x16 box.
theme dark (default) for use on a dark/photo-backdrop panel, or light for a flat light card.