Template:Ink chip: Difference between revisions
IssuePress (talk | contribs) No edit summary |
Robertbaxter (talk | contribs) No edit summary |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<noinclude> | <noinclude>{{DISPLAYTITLE:Template:ink chip}} | ||
This template displays links to ink color pages as visually styled [https://m3.material.io/components/chips/overview chips]. | This template displays links to ink color pages as visually styled [https://m3.material.io/components/chips/overview chips]. | ||
Line 5: | Line 5: | ||
To display an ink chip, use the following syntax: | To display an ink chip, use the following syntax: | ||
<pre> | <pre> | ||
{{ | {{ink chip|Violet}} | ||
</pre><div>{{ | </pre> | ||
<div>{{ink chip|Violet}}</div> | |||
Ink chips can be included inline within a paragraph using <code><nowiki>{{ink chip|Yellow}}</nowiki></code> to produce a {{ink chip|Yellow}} chip. When used this way, they appear smaller to maintain the article's visual flow. | |||
===Advanced attributes=== | ===Advanced attributes=== | ||
To display a custom label for the chip, use the optional | To display a custom label for the chip, use the optional <code>label</code> attribute: | ||
<pre> | <pre> | ||
{{ | {{ink chip|Fluorescent Orange|label=Fluo. Orange}} | ||
</pre><div>{{ | </pre> | ||
<div>{{ink chip|Fluorescent Orange|label=Fluo. Orange}}</div> | |||
== | ==Error Handling== | ||
If the specified page does not exist, the chip will display without a color background and include a red link: | If the specified page does not exist, the chip will display without a color background and include a red link: | ||
<pre> | <pre> | ||
{{ | {{ink chip|Huckleberry}} | ||
</pre> | </pre> | ||
<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>}}</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);">[[{{{1|}}}|{{{label|{{{1|}}}}}}]]</span>|<span class="chip color-chip">[[{{{1|}}}|{{{label|{{{1|}}}}}}]]</span>}}</includeonly> |
Latest revision as of 14:08, 14 October 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}}
Ink chips can be included inline within a paragraph using {{ink chip|Yellow}}
to produce a 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}}
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}}