Template:Capsule/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{Doc/subpage}}
{{Doc/subpage}}
This template is designed to add a block with rounded corners with text inside.
This template is designed to add a block with rounded corners with text inside.


{{ModernTodo|Better documentation.}}
== Parameters and Examples ==
 
{| class=standard-table | style="width:100%;"
== Examples ==
|-
{{CodeBlock|style=1|<nowiki>{{Capsule|Hello, World!}}</nowiki>}}
! width=15% | Parameter
{{Capsule|Hello, World!}}
! Description
 
! Example
 
! width=30% | Preview
{{CodeBlock|style=1|<nowiki>{{Capsule|style=1|Hello, World!}}</nowiki>}}
|-
{{Capsule|style=1|Hello, World!}}
| align="center" | ''No parameters''
 
| Reverts to default styling
 
| {{CodeBlock|<nowiki>{{Capsule}}</nowiki>}}
{{CodeBlock|style=1|<nowiki>{{Capsule|style=2|Hello, World!}}</nowiki>}}
| {{Capsule}}
{{Capsule|style=2|Hello, World!}}
|-
 
| align="center" | {{code|{{param|1}}}} or {{code|{{param|text}}}}
 
| For text input
{{CodeBlock|style=1|<nowiki>{{Capsule|style=3|Some text}}</nowiki>}}
| {{CodeBlock|<nowiki>{{Capsule|Hello, world!}}</nowiki>}} {{CodeBlock|<nowiki>{{Capsule|text=Hello, world!}}</nowiki>}}
{{Capsule|style=3|Some text}}
| {{Capsule|Hello, world!}}
 
|-
 
| align="center" | {{code|{{param|align}}}}
{{CodeBlock|style=1|<nowiki>{{Capsule|style=1|Some text}}</nowiki>}}
| For specifying text alignment
{{Capsule|style=1|Some text}}
| {{CodeBlock|<nowiki>{{Capsule|Hello, world!|align=left}}</nowiki>}} {{CodeBlock|<nowiki>{{Capsule|Hello, world!|align=center}}</nowiki>}} {{CodeBlock|<nowiki>{{Capsule|Hello, world!|align=right}}</nowiki>}}
 
| {{Capsule|Hello, world!|align=left}} {{Capsule|Hello, world!|align=center}} {{Capsule|Hello, world!|align=right}}
 
|-
{{CodeBlock|style=1|<nowiki>{{Capsule
! colspan=4 | Styling parameters
| style = 1
|-
| bg = #294157
| align="center" | {{code|{{param|bg}}}}
| align = center
| Background value
| text = [[File:Icon-panorama-filled.png|text-bottom|16px|link=]] <b style="color:white">Hello, World!</b>
| {{CodeBlock|<nowiki>{{Capsule|bg=#294157}}</nowiki>}}
}}</nowiki>}}
| {{Capsule|bg=#294157}}
{{Capsule
|-
| style = 1
| align="center" | {{code|{{param|style}}}}
| bg = #294157
| Used to change preset styling of the capsule.
| align = center
| {{CodeBlock|<nowiki>{{Capsule|style=1}}</nowiki>}} {{CodeBlock|<nowiki>{{Capsule|style=2}}</nowiki>}} {{CodeBlock|<nowiki>{{Capsule|style=3}}</nowiki>}}
| text = [[File:Icon-panorama-filled.png|text-bottom|16px|link=]] <b style="color:white">Hello, World!</b>
| {{Capsule|style=1}} {{Capsule|style=2}} {{Capsule|style=3}}
}}
|}

Revision as of 18:22, 23 July 2023

Edit-copy.png
This is a documentation subpage for Template:Capsule.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

This template is designed to add a block with rounded corners with text inside.

Parameters and Examples

Parameter Description Example Preview
No parameters Reverts to default styling
{{Capsule}}
{{{1}}} or {{{text}}} For text input
{{Capsule|Hello, world!}}
{{Capsule|text=Hello, world!}}
Hello, world!
{{{align}}} For specifying text alignment
{{Capsule|Hello, world!|align=left}}
{{Capsule|Hello, world!|align=center}}
{{Capsule|Hello, world!|align=right}}
Hello, world!
Hello, world!
Hello, world!
Styling parameters
{{{bg}}} Background value
{{Capsule|bg=#294157}}
{{{style}}} Used to change preset styling of the capsule.
{{Capsule|style=1}}
{{Capsule|style=2}}
{{Capsule|style=3}}