Template:Resize

From Safer nicotine wiki

{{{1}}}

Template documentation[view] [edit] [history] [purge]
It is to change the font size of a text string.

Usage

  • Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value).N specifies a size, such as "95%", "1.2em", etc.
  • Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value). — If N is omitted, as in the second line above, a default 90% size is applied.
  • Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value). — As above but uses a div tag instead of a span tag.

Beware

Beware that if text happens to contain an equality sign (=), it will fail to render properly. Here are the workarounds:

  1. Replace all instances of = with {{=}}, or
  2. Specify Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value). or Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value)..

Also it will fail to wrap multiple blocks, such as multiple paragraphs or multiple bullet points. Here are the workarounds:

  1. Use, for example,
    <div style="font-size:90%;">
    ...multiple paragraphs...
    </div>, or
  2. Apply this template separately to each block of paragraph, bullet point etc.
  3. Use Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value)..
  4. Use {{smalldiv}}.

Examples

Code Result
Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value). This text defaults to 90% normal size.
Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value). This text is 80% normal size.
Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value). This text is 0.2em larger than normal.
{{resize|We know 1+1=2 and 2+2=4. It will fail to render}} {{{1}}}
{{resize|We know 1+1{{=}}2 and 2+2{{=}}4.}} We know 1+1=2 and 2+2=4.
{{resize|1=We know 1+1=2 and 2+2=4.}} We know 1+1=2 and 2+2=4.
{{resize|120%|2=We know 1+1=2 and 2+2=4. This text is 120% normal size.}} We know 1+1=2 and 2+2=4. This text is 120% normal size.

Comparison

List of Resize Shortcuts
Code Equivalent Result
{{smaller|text}} Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value). text
{{larger|text}} Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value). text
{{large|text}} Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value). text
Font size templates
Code Size Semantics Result
{{small|text}} 85% ‎<small> text
{{smaller|text}} 90% none text
{{resize|text}} 90% none text
{{midsize|text}} 92% none text
none 100% none text
{{larger|text}} 110% none text
{{big|text}} 120% ‎<big> text
{{large|text}} 125% none text
{{huge|text}} 180% none text
{{resize|x%}} custom none varies
{{font|size=x%}} custom none varies

See also

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools.

Resize

It is to change the font size of a text string. Two forms {{resize|<size>|<text>}} and {{resize|<text>}} are possible.

Template parameters

ParameterDescriptionTypeStatus
Size/Text1

Specifies a css font size e.g. '80%', '1.2em', 'x-large', 'larger'. In the one parameter version the first parameter is the text and the font size is '90%'.

Stringrequired
Text when size is given2

The text to display in the two parameter version.

Stringoptional
Use div tagdiv

Set to yes to use a div instead of a span tag.

Stringoptional
Cookies help us deliver our services. By using our services, you agree to our use of cookies.