Template:Ink chip: Difference between revisions

From stencil.wiki
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 29: Line 29:
<div>{{ink chip|Huckleberry}}</div>
<div>{{ink chip|Huckleberry}}</div>


</noinclude><includeonly>{{#ifexist:{{{1}}}|<span class="chip color-chip text-{{#ifexpr:{{#invoke:Color|csvrgbToLum|{{#show:{{{1}}}|?Has rgb#}}}}>75|black|white}}" style="background:rgba({{#show:{{{1}}}|?Has rgb#}},1);border-color:rgba({{#show:{{{1}}}|?Has rgb#}},1);">[[{{{1|}}}|{{{label|{{{1|}}}}}}]]</span>|<span class="chip color-chip">[[{{{1|}}}|{{{label|{{{1|}}}}}}]]</span>}}<templatestyles src="Template:Ink chip/styles.css" /></includeonly>
</noinclude><includeonly>{{#ifexist:{{{1}}}|<span class="chip color-chip text-{{#ifexpr:{{#invoke:Color|csvrgbToLum|{{#show:{{{1}}}|?Has rgb#}}}}>75|black|white}}" style="background:rgba({{#show:{{{1}}}|?Has rgb#}},1);border-color:rgba({{#show:{{{1}}}|?Has rgb#}},1);">{{#ifeq:{{{1|}}}|{{PAGENAME}}|{{{1|}}}|{{{label|{{{1|}}}}}}|[[{{{1|}}}|{{{label|{{{1|}}}}}}]]}}</span>|<span class="chip color-chip">[[{{{1|}}}|{{{label|{{{1|}}}}}}]]<templatestyles src="Template:Ink chip/styles.css" /></includeonly>

Revision as of 17:36, 29 November 2025

This template displays links to ink color pages as visually styled chips.

Usage

To display an ink chip, use the following syntax:

{{ink chip|Violet}}
{{#ifexist:Violet|Violet|Violet


Ink chips can be included inline within a paragraph using {{ink chip|Yellow}} to produce a {{#ifexist:Yellow|Yellow|Yellow chip. When used this way, they appear smaller to maintain the article's visual flow.


Advanced attributes

To display a custom label for the chip, use the optional label attribute:

{{ink chip|Fluorescent Orange|label=Fluo. Orange}}
{{#ifexist:Fluorescent Orange|Fluo. Orange|Fluo. Orange


Error Handling

If the specified page does not exist, the chip will display without a color background and include a red link:

{{ink chip|Huckleberry}}
{{#ifexist:Huckleberry|<span class="chip color-chip text-Expression error: Unexpected < operator." style="background:rgba(,1);border-color:rgba(,1);">Huckleberry|Huckleberry