Template:Text-icon/doc

From Angelina Jordan Wiki
Revision as of 22:58, 13 September 2025 by Dcljr (talk | contribs) (expand)
This is a subpage documenting Template:Text-icon. To change the template, edit that page; to change the template's documentation (seen below), edit this one.

Documentation

This template displays a little makeshift text-only icon. This is usually called from other more "useful" templates. If you use this separately, you might want to enclose it in a <sup> (superscript) element, since that is not done by default.

Usage

  • {{text-icon|text=|color=|background-color=|font-weight=|font-family=|border=|tip=|space-same-font=}}

The text shown in the icon (usually a single character) is specified in the named parameter text. For convenience, this can also be passed to the template in the first positional parameter (i.e., you can omit the text= name from the template call).

The parameters color, background-color, font-weight, font-family, and border are used as the values of the same-named CSS style attributes in a <span> element. The default values are:

color=white; background-color=#e00; font-weight=bold; font-family=monospace; border=0;

See, for example, W3C's CSS2 documentation for other valid values.

The parameter tip can be used to specify a "tooltip" to show when the reader "hovers" on the icon. Note that double-quote characters (") cannot be used in the value of tip because the tooltip text is already enclosed by double quotes in the template code. This might be changed in the future. For now, if you want to quote something, you'll have to use single quotes ('). Some templates that call this one already have their own mechanisms for creating tooltips. This should be remedied eventually.

The parameter space-same-font can be set to any true value to render the space characters (non-breaking spaces, to be specific) surrounding the text in the same font. This might be necessary to fix certain display issues. Otherwise, the space characters are rendered using the default font.

Examples

  • {{text-icon|text=🞂}} 🞂 
  • {{text-icon|text=🞂|color=white|background-color=red}} 🞂 
  • {{text-icon|text=i|color=white|background-color=blue|font-weight=bold|font-family=monospace|tip=information}} i 
  • {{text-icon|text=i|color=white|background-color=blue|font-weight=bold|font-family=monospace|tip=information|space-same-font=y}} i 

See also

Templates that call this one:    [edit this list]