This is a documentation for Board Game Arena: play board games online !

Template:Text: Difference between revisions

From Board Game Arena
Jump to navigation Jump to search
(compressed | removed: bg (fallback for old browsers), bgd | replaced: bg1→2, bg2→3, wrap→wr, h→x, v→y, rem→em)
(inline-block option for Template:Pill)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<span style="color:{{{c}}};font-size:{{{s}}}em;font-weight:{{{w}}};font-style:{{{i}}};font-family:{{{f}}};white-space:{{{wr}}};-webkit-text-stroke:{{{ow|.5}}}px {{{oc}}};border:{{{bw|2}}}px {{{bs|solid}}} {{{bc}}};border-radius:{{{br}}}em;padding:{{{y|0}}}px {{{x|0}}}px {{{y|0}}}px {{{x|0}}}px;background:linear-gradient(90deg in oklch,{{{2|#fff0}}},{{{3|{{{2|#fff0}}}}}})">{{{1|A}}}</span><noinclude>
<onlyinclude><span style="display:inline-block;{{{bl|d}}}isplay:inline;color:{{{c}}};font-size:{{{s}}}em;font-weight:{{{w}}};font-style:{{{i}}};font-family:{{{f}}};white-space:{{{wr}}};-webkit-text-stroke:{{{ow|.5}}}px {{{oc}}};border:{{{bw|2}}}px {{{bs|solid}}} {{{bc}}};border-radius:{{{br}}}em;padding:{{{y|0}}}px {{{x|0}}}px {{{y|0}}}px {{{x|0}}}px;background:linear-gradient(90deg in oklch,{{{2|#fff0}}},{{{3|{{{2|#fff0}}}}}})">{{{1|A}}}</span></onlyinclude>


== Examples ==
== Examples ==
Line 36: Line 36:
   <div><code><nowiki>{{text|some text}}</nowiki></code></div>
   <div><code><nowiki>{{text|some text}}</nowiki></code></div>
   <div>{{text|some text}}</div>
   <div>{{text|some text}}</div>
   <div>'''''Required:''''' content.</div>
   <div>Content.</div>
   <div><code>c</code></div>
   <div><code>c</code></div>
   <div>color</div>
   <div>color</div>
Line 42: Line 42:
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|c=green|<nowiki>|c=green}}</nowiki>}}</code></div>
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|c=green|<nowiki>|c=green}}</nowiki>}}</code></div>
   <div>{{text|some text|c=green}}</div>
   <div>{{text|some text|c=green}}</div>
   <div>'''''Optional:''''' text color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color_value CSS color value].</div>
   <div>Text color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color_value CSS color value].</div>
   <div><code>s</code></div>
   <div><code>s</code></div>
   <div>size</div>
   <div>size</div>
Line 48: Line 48:
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|s=1.5|<nowiki>|s=1.5}}</nowiki>}}</code></div>
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|s=1.5|<nowiki>|s=1.5}}</nowiki>}}</code></div>
   <div>{{text|some text|s=1.5}}</div>
   <div>{{text|some text|s=1.5}}</div>
   <div>'''''Optional:''''' relative text size in [https://developer.mozilla.org/en-US/docs/Web/CSS/length#em em units] (<code>1em</code> = unchanged size).</div>
   <div>Relative text size in [https://developer.mozilla.org/en-US/docs/Web/CSS/length#em em units] (<code>1em</code> = unchanged size).</div>
   <div><code>w</code></div>
   <div><code>w</code></div>
   <div>weight</div>
   <div>weight</div>
Line 54: Line 54:
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|w=bold|<nowiki>|w=bold}}</nowiki>}}</code></div>
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|w=bold|<nowiki>|w=bold}}</nowiki>}}</code></div>
   <div>{{text|some text|w=bold}}</div>
   <div>{{text|some text|w=bold}}</div>
   <div>'''''Optional:''''' text weight as a [https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight CSS {{code|c=#3366cc|font-weight}} value].</div>
   <div>Text weight as a [https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight CSS {{code|c=#3366cc|font-weight}} value].</div>
   <div><code>i</code></div>
   <div><code>i</code></div>
   <div>italic</div>
   <div>italic</div>
Line 60: Line 60:
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|i=italic|<nowiki>|i=italic}}</nowiki>}}</code></div>
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|i=italic|<nowiki>|i=italic}}</nowiki>}}</code></div>
   <div>{{text|some text|i=italic}}</div>
   <div>{{text|some text|i=italic}}</div>
   <div>'''''Optional:''''' text style as a [https://developer.mozilla.org/en-US/docs/Web/CSS/font-style CSS {{code|c=#3366cc|font-style}} value].</div>
   <div>Text style as a [https://developer.mozilla.org/en-US/docs/Web/CSS/font-style CSS {{code|c=#3366cc|font-style}} value].</div>
   <div><code>f</code></div>
   <div><code>f</code></div>
   <div>font</div>
   <div>font</div>
Line 66: Line 66:
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|f=cursive|<nowiki>|f=cursive</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|f=cursive|<nowiki>|f=cursive</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div>{{text|some text|f=cursive}}</div>
   <div>{{text|some text|f=cursive}}</div>
   <div>'''''Optional:''''' font name as a [https://developer.mozilla.org/en-US/docs/Web/CSS/font-family CSS {{code|c=#3366cc|font-family}} value].</div>
   <div>Font name as a [https://developer.mozilla.org/en-US/docs/Web/CSS/font-family CSS {{code|c=#3366cc|font-family}} value].</div>
   <div><code>oc</code></div>
   <div><code>oc</code></div>
   <div>outline color</div>
   <div>outline color</div>
Line 72: Line 72:
   <div><code><nowiki>{{text|some text</nowiki></code><br><code><nowiki>|c=transparent</nowiki></code><br><code>{{text|c=transparent|oc=green|<nowiki>|oc=green</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div><code><nowiki>{{text|some text</nowiki></code><br><code><nowiki>|c=transparent</nowiki></code><br><code>{{text|c=transparent|oc=green|<nowiki>|oc=green</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div>{{text|some text|c=transparent|oc=green}}</div>
   <div>{{text|some text|c=transparent|oc=green}}</div>
   <div>'''''Optional:''''' text outline color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color_value CSS color value].</div>
   <div>Text outline color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color_value CSS color value].</div>
   <div><code>ow</code></div>
   <div><code>ow</code></div>
   <div>outline weight</div>
   <div>outline weight</div>
Line 78: Line 78:
   <div><code><nowiki>{{text|some text</nowiki></code><br><code><nowiki>|c=transparent</nowiki></code><br><code>{{text|wrap=nowrap|c=transparent|oc=grey|ow=1|<nowiki>|oc=grey|ow=1</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div><code><nowiki>{{text|some text</nowiki></code><br><code><nowiki>|c=transparent</nowiki></code><br><code>{{text|wrap=nowrap|c=transparent|oc=grey|ow=1|<nowiki>|oc=grey|ow=1</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div>{{text|some text|c=transparent|oc=grey|ow=1}}</div>
   <div>{{text|some text|c=transparent|oc=grey|ow=1}}</div>
   <div>'''''Optional:''''' text outline weight in [https://developer.mozilla.org/en-US/docs/Web/CSS/length#px px units].</div>
   <div>Text outline weight in [https://developer.mozilla.org/en-US/docs/Web/CSS/length#px px units].</div>
   <div><code>wr</code></div>
   <div><code>wr</code></div>
   <div>wrap</div>
   <div>wrap</div>
Line 84: Line 84:
   <div><code><nowiki>{{text|some text|wr=nowrap}}</nowiki></code></div>
   <div><code><nowiki>{{text|some text|wr=nowrap}}</nowiki></code></div>
   <div>{{text|some text|wr=nowrap}}</div>
   <div>{{text|some text|wr=nowrap}}</div>
   <div>'''''Optional:''''' prevent line breaks.</div>
   <div>Prevent line breaks.</div>
</div>
</div>


Line 100: Line 100:
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|<nowiki>|lightgreen</nowiki>|lightgreen}}<nowiki>}}</nowiki></code></div>
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|<nowiki>|lightgreen</nowiki>|lightgreen}}<nowiki>}}</nowiki></code></div>
   <div>{{text|some text|lightgreen}}</div>
   <div>{{text|some text|lightgreen}}</div>
   <div>'''''Optional:''''' background color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color_value CSS color value].</div>
   <div>Background color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color_value CSS color value].</div>
   <div>3</div>
   <div>3</div>
   <div>background<br>end color</div>
   <div>background<br>end color</div>
Line 106: Line 106:
   <div><code><nowiki>{{text|some text</nowiki></code><br><code><nowiki>|transparent</nowiki></code><br><code>{{text|<nowiki>|lightgreen</nowiki>|transparent|lightgreen}}<nowiki>}}</nowiki></code></div>
   <div><code><nowiki>{{text|some text</nowiki></code><br><code><nowiki>|transparent</nowiki></code><br><code>{{text|<nowiki>|lightgreen</nowiki>|transparent|lightgreen}}<nowiki>}}</nowiki></code></div>
   <div>{{text|some text|transparent|lightgreen}}</div>
   <div>{{text|some text|transparent|lightgreen}}</div>
   <div>'''''Optional:''''' background stop color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color_value CSS color value].</div>
   <div>Background stop color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color_value CSS color value].</div>
   <div><code>bc</code></div>
   <div><code>bc</code></div>
   <div>border color</div>
   <div>border color</div>
Line 112: Line 112:
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|bc=green|<nowiki>|bc=green</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|bc=green|<nowiki>|bc=green</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div>{{text|some text|bc=green}}</div>
   <div>{{text|some text|bc=green}}</div>
   <div>'''''Optional:''''' border color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color_value CSS color value].</div>
   <div>Border color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color_value CSS color value].</div>
   <div><code>bw</code></div>
   <div><code>bw</code></div>
   <div>border weight</div>
   <div>border weight</div>
Line 118: Line 118:
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|wrap=nowrap|bc=grey|bw=4|<nowiki>|bc=grey|bw=4</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|wrap=nowrap|bc=grey|bw=4|<nowiki>|bc=grey|bw=4</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div>{{text|some text|bc=grey|bw=4}}</div>
   <div>{{text|some text|bc=grey|bw=4}}</div>
   <div>'''''Optional:''''' border weight in [https://developer.mozilla.org/en-US/docs/Web/CSS/length#px px units].</div>
   <div>Border weight in [https://developer.mozilla.org/en-US/docs/Web/CSS/length#px px units].</div>
   <div><code>bs</code></div>
   <div><code>bs</code></div>
   <div>border style</div>
   <div>border style</div>
Line 124: Line 124:
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|wrap=nowrap|bc=grey|bs=dashed|<nowiki>|bc=grey|bs=dashed</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|wrap=nowrap|bc=grey|bs=dashed|<nowiki>|bc=grey|bs=dashed</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div>{{text|some text|bc=grey|bs=dashed}}</div>
   <div>{{text|some text|bc=grey|bs=dashed}}</div>
   <div>'''''Optional:''''' border style as a [https://developer.mozilla.org/en-US/docs/Web/CSS/border-style CSS {{code|c=#3366cc|border-style}} value].</div>
   <div>Border style as a [https://developer.mozilla.org/en-US/docs/Web/CSS/border-style CSS {{code|c=#3366cc|border-style}} value].</div>
   <div><code>br</code></div>
   <div><code>br</code></div>
   <div>border radius</div>
   <div>border radius</div>
Line 130: Line 130:
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|bc=grey|x=4|br=1|<nowiki>|bc=grey|x=4|br=1</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|bc=grey|x=4|br=1|<nowiki>|bc=grey|x=4|br=1</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div>{{text|some text|bc=grey|x=4|br=1}}</div>
   <div>{{text|some text|bc=grey|x=4|br=1}}</div>
   <div>'''''Optional:''''' border radius in [https://developer.mozilla.org/en-US/docs/Web/CSS/length#em em units] (<code>1em</code> = unchanged font <code>s</code>ize).</div>
   <div>Border radius in [https://developer.mozilla.org/en-US/docs/Web/CSS/length#em em units] (<code>1em</code> = unchanged font <code>s</code>ize).</div>
   <div><code>x</code></div>
   <div><code>x</code></div>
   <div>horizontal spacing</div>
   <div>horizontal spacing</div>
Line 136: Line 136:
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|bc=grey|x=8|<nowiki>|bc=grey|x=8</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div><code><nowiki>{{text|some text</nowiki></code><br><code>{{text|bc=grey|x=8|<nowiki>|bc=grey|x=8</nowiki>}}<nowiki>}}</nowiki></code></div>
   <div>{{text|some text|bc=grey|x=8}}</div>
   <div>{{text|some text|bc=grey|x=8}}</div>
   <div>'''''Optional:''''' horizontal spacing in [https://developer.mozilla.org/en-US/docs/Web/CSS/length#px px units].</div>
   <div>Horizontal spacing in [https://developer.mozilla.org/en-US/docs/Web/CSS/length#px px units].</div>
   <div><code>y</code></div>
   <div><code>y</code></div>
   <div>vertical spacing</div>
   <div>vertical spacing</div>
Line 142: Line 142:
   <div><code><nowiki>{{text|some text</nowiki></code><br><code><span style="line-height:2.6;">{{text|bc=grey|y=8|<nowiki>|bc=grey|y=8</nowiki>}}</span><nowiki>}}</nowiki></code></div>
   <div><code><nowiki>{{text|some text</nowiki></code><br><code><span style="line-height:2.6;">{{text|bc=grey|y=8|<nowiki>|bc=grey|y=8</nowiki>}}</span><nowiki>}}</nowiki></code></div>
   <div>{{text|some text|bc=grey|y=8}}</div>
   <div>{{text|some text|bc=grey|y=8}}</div>
   <div>'''''Optional:''''' vertical spacing in [https://developer.mozilla.org/en-US/docs/Web/CSS/length#px px units].</div>
   <div>Vertical spacing in [https://developer.mozilla.org/en-US/docs/Web/CSS/length#px px units].</div>
  <div><code>bl</code></div>
  <div>block</div>
  <div>not set</div>
  <div><code><nowiki>{{text|some text</nowiki></code><br><code><nowiki>|bl=}}</nowiki></code></div>
  <div>{{text|some text|bl=}}</div>
  <div>Display as an inline block instead of flowing in line text.</div>
</div>
</div>
<noinclude>
== Pages using {{FULLPAGENAME}} ==
{{Special:WhatLinksHere/{{FULLPAGENAME}}}}
</noinclude>


[[Category:WikiTemplates]]
[[Category:TextTemplates]]
</noinclude>

Latest revision as of 13:18, 8 August 2026

A

Examples

Inside this blue text template you can nest other red, bold, bigger, yellow highlight, orange to green gradient, circled text templates or any other customised combination!

{{text|c=blue|Inside this blue text template you can nest other {{text|red|c=red}}, {{text|bold|w=bold}}, {{text|bigger|s=1.4}}, {{text|yellow highlight|yellow}}, {{text|orange to green gradient|#fc8|#cf8}}, {{text|circled|bc=red|br=1|x=4}} text templates or any other customised combination!}}

Template:Pill

pill background

{{pill|pill background|green}}

Template:Code

red color code

{{code|red color code}}

Parameters

Text

Id
Name
Default
Example
Result
Description
1
text
A
{{text|some text}}
some text
Content.
c
color
unchanged
{{text|some text
|c=green}}
some text
Text color as a CSS color value.
s
size
unchanged
{{text|some text
|s=1.5}}
some text
Relative text size in em units (1em = unchanged size).
w
weight
unchanged
{{text|some text
|w=bold}}
some text
Text weight as a CSS font-weight value.
i
italic
unchanged
{{text|some text
|i=italic}}
some text
Text style as a CSS font-style value.
f
font
unchanged
{{text|some text
|f=cursive}}
some text
Font name as a CSS font-family value.
oc
outline color
transparent
{{text|some text
|c=transparent
|oc=green}}
some text
Text outline color as a CSS color value.
ow
outline weight
0.5
{{text|some text
|c=transparent
|oc=grey|ow=1}}
some text
Text outline weight in px units.
wr
wrap
wrap
{{text|some text|wr=nowrap}}
some text
Prevent line breaks.

Background & border

Id
Name
Default
Example
Result
Description
2
background
transparent
{{text|some text
|lightgreen}}
some text
Background color as a CSS color value.
3
background
end color
transparent
{{text|some text
|transparent
|lightgreen}}
some text
Background stop color as a CSS color value.
bc
border color
transparent
{{text|some text
|bc=green}}
some text
Border color as a CSS color value.
bw
border weight
1
{{text|some text
|bc=grey|bw=4}}
some text
Border weight in px units.
bs
border style
solid
{{text|some text
|bc=grey|bs=dashed}}
some text
Border style as a CSS border-style value.
br
border radius
0
{{text|some text
|bc=grey|x=4|br=1}}
some text
Border radius in em units (1em = unchanged font size).
x
horizontal spacing
0
{{text|some text
|bc=grey|x=8}}
some text
Horizontal spacing in px units.
y
vertical spacing
0
{{text|some text
|bc=grey|y=8}}
some text
Vertical spacing in px units.
bl
block
not set
{{text|some text
|bl=}}
some text
Display as an inline block instead of flowing in line text.

Pages using Template:Text