Template:Capsule/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
 
(17 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<noinclude>{{doc|0}}</noinclude>
{{Doc/subpage}}
This template is based on a capsule from the Wiki's [[Main Page]].
This template is designed to add a block with rounded corners with text inside.


== Parameters ==
== Parameters and Examples ==
{{param|1}} - input content
{| class=standard-table | style="width:100%;"
 
|-
{{param|align}} - controls the alignment of the contents of the capsule
! width=15% | Parameter
 
! Description
{{param|color}} - controls the color of the plain text
! Example
 
! width=30% | Preview
{{param|capbg}} - controls the capsule background
|-
 
| align="center" | ''No parameters''
{{param|contbg}} - controls the background of the capsule content
| Reverts to default styling
 
| {{CodeBlock|<nowiki>{{Capsule}}</nowiki>}}
== Examples ==
| {{Capsule}}
{{MdCodeBlock|outline|margin=.4em 0 .5em 0|<nowiki>{{capsule|capbg=#4a6821|Some text}}</nowiki>}}
|-
{{capsule|capbg=#4a6821|Some text}}
| align="center" | {{code|{{param|1}}}} or {{code|{{param|text}}}}
 
| For text input
{{MdCodeBlock|outline|margin=.4em 0 .5em 0|<nowiki>{{capsule|capbg=#253b4e|contbg=#2b4c6a|align=center|color=#fff|<!--
| {{CodeBlock|<nowiki>{{Capsule|Hello, world!}}</nowiki>}} {{CodeBlock|<nowiki>{{Capsule|text=Hello, world!}}</nowiki>}}
-->[[File:Steamtours workshop.png|link=SteamVR/Environments]] &nbsp; [[SteamVR/Environments|<span style="color:white;">'''Go to the SteamVR Workshop Tools documentation index'''</span>]]
| {{Capsule|Hello, world!}}
}}</nowiki>
|-
}}
! colspan=4 | Styling parameters
 
|-
{{capsule|capbg=#253b4e|contbg=#2b4c6a|align=center|color=#fff|<!--
| align="center" | {{code|{{param|align}}}}
-->[[File:Steamtours workshop.png|link=SteamVR/Environments]] &nbsp; [[SteamVR/Environments|<span style="color:white;">'''Go to the SteamVR Workshop Tools documentation index'''</span>]]
| For specifying text alignment
}}
| {{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}}
|-
| align="center" | {{code|{{param|bg}}}}
| Background value
| {{CodeBlock|<nowiki>{{Capsule|bg=#294157}}</nowiki>}}
| {{Capsule|bg=#294157}}
|-
| align="center" | {{code|{{param|radius}}}}
| For setting the border radius
| {{CodeBlock|<nowiki>{{Capsule|radius=1em}}</nowiki>}}
| {{Capsule|radius=1em}}
|-
| align="center" | {{code|{{param|padding}}}}
| Padding value
| {{CodeBlock|<nowiki>{{Capsule|padding=2em}}</nowiki>}}
| {{Capsule|padding=2em}}
|-
| align="center" | {{code|{{param|margin}}}}
| Margin value
| {{CodeBlock|<nowiki>{{Capsule|margin=0 1em}}</nowiki>}}
| {{Capsule|margin=0 1em}}
|-
| align="center" | {{code|{{param|height}}}}
| For specifying capsule height
| {{CodeBlock|<nowiki>{{Capsule|height=100px}}</nowiki>}}
| {{Capsule|height=100px}}
|-
| align="center" | {{code|{{param|style}}}}
| Used to change preset styling of the capsule.
| {{CodeBlock|<nowiki>{{Capsule|style=1}}</nowiki>}} {{CodeBlock|<nowiki>{{Capsule|style=2}}</nowiki>}} {{CodeBlock|<nowiki>{{Capsule|style=3}}</nowiki>}}
| {{Capsule|style=1}} {{Capsule|style=2}} {{Capsule|style=3}}
|}

Latest revision as of 18:27, 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!
Styling parameters
{{{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!
{{{bg}}} Background value
{{Capsule|bg=#294157}}
{{{radius}}} For setting the border radius
{{Capsule|radius=1em}}
{{{padding}}} Padding value
{{Capsule|padding=2em}}
{{{margin}}} Margin value
{{Capsule|margin=0 1em}}
{{{height}}} For specifying capsule height
{{Capsule|height=100px}}
{{{style}}} Used to change preset styling of the capsule.
{{Capsule|style=1}}
{{Capsule|style=2}}
{{Capsule|style=3}}