Template:Ink chip: Difference between revisions

From stencil.wiki
No edit summary
No edit summary
Line 1: Line 1:
<noinclude>
<noinclude>
A template to display links to ink color pages as [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].  


==Usage==
==Usage==
 
To display an ink chip, use the following syntax:
<pre>
<pre>
{{Ink chip|Violet}}
{{Ink chip|Violet}}
</pre><div>{{Ink chip|Violet}}</div>
</pre><div>{{Ink chip|Violet}}</div>


<pre>
Ink chips can be included inline within a paragraph using {{code|<nowiki>{{Ink chip|yellow}}</nowiki>|inline=y}} to produce a {{Ink chip|yellow}} chip. When used this way, they appear smaller to maintain the article's visual flow.  
Ink chips can be included inline within a paragraph using {{Ink chip|yellow}}. When used this way, they appear smaller to maintain the article's visual flow.
</pre>
 
Ink chips can be included inline within a paragraph using {{Ink chip|yellow}}. When used this way, they appear smaller to maintain the article's visual flow.  


===Advanced attributes===
===Advanced attributes===
Sometimes you will need the chip label to be different from the full ink name, you can use that by adding the {{code|label|inline=y}} attribute:
To display a custom label for the chip, use the optional {{code|label|inline=y}} attribute:
<pre>
<pre>
{{Ink chip|Fluorescent Orange|label=Fluo. Orange}}
{{Ink chip|Fluorescent Orange|label=Fluo. Orange}}
Line 21: Line 17:


===Missing pages===
===Missing pages===
If a chip is requested for a page that does not exist, it will be shown as a chip but with no color background and 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>

Revision as of 15:08, 11 December 2024

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 Template:Code 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 Template:Code attribute:

{{Ink chip|Fluorescent Orange|label=Fluo. Orange}}

Missing pages

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

{{Ink chip|Huckleberry}}