Template
Fa
From Dogcraft Wiki
No edit summary |
(proper documentation + templatedata) |
||
Line 1: | Line 1: | ||
<i class="fa-{{{2|solid}}} fa-{{{1|square}}}" style="color:{{{color|black}}}; {{{style|}}}"></i> | <includeonly><i class="fa-{{{2|solid}}} fa-{{{1|square}}}" style="color:{{{color|black}}}; {{{style|}}}"></i></includeonly> | ||
<noinclude> | |||
==FontAwesome template== | |||
This template adds a [https://fontawesome.com/ FontAwesome] icon. Add wherever you need such an icon. | |||
The [https://fontawesome.com/search https://fontawesome.com/search] site can be used to search for icons. After finding a suitable one, click on it, and copy its name. (Clicking on the name copies it.) The default style used is "Solid", but it can be set using the template's second (unnamed) parameter. The icon's color can also be changed using the <tt>|color=</tt> property. | |||
===Example=== | |||
* <code><nowiki>{{fa|alarm-clock}}</nowiki></code> generates: {{fa|alarm-clock}} | |||
* <code><nowiki>{{fa|alarm-clock|regular}}</nowiki></code> generates: {{fa|alarm-clock|regular}} | |||
* <code><nowiki>{{fa|alarm-clock|regular|color=blue}}</nowiki></code> generates: {{fa|alarm-clock|regular|color=blue}} | |||
===Template Data=== | |||
<noinclude> | |||
<templatedata> | |||
{ | |||
"params": { | |||
"1": { | |||
"label": "Icon name", | |||
"description": "The name of the FA icon, without the \"fa-\" prefix.", | |||
"example": "folder-open", | |||
"type": "string", | |||
"required": true, | |||
"suggested": true | |||
}, | |||
"2": { | |||
"label": "Icon style", | |||
"description": "Optional parameter for setting the icon's style. Options are: solid, regular, light, thin, duotone. Solid is the default, and using it is recommended for consistency.", | |||
"example": "regular", | |||
"type": "string", | |||
"default": "solid", | |||
"suggested": true | |||
}, | |||
"color": { | |||
"label": "Icon color", | |||
"description": "Optional parameter for the icon's color", | |||
"example": "red, #8b0024", | |||
"type": "string", | |||
"default": "black", | |||
"suggested": true | |||
}, | |||
"style": { | |||
"label": "Further styling", | |||
"description": "Optional parameter for setting further CSS styles.", | |||
"type": "string", | |||
"suggested": true | |||
} | |||
}, | |||
"description": "Adds a FontAwesome icon", | |||
"format": "inline" | |||
} | |||
</templatedata> | |||
</noinclude> |
Revision as of 23:53, 11 July 2022
FontAwesome template
This template adds a FontAwesome icon. Add wherever you need such an icon.
The https://fontawesome.com/search site can be used to search for icons. After finding a suitable one, click on it, and copy its name. (Clicking on the name copies it.) The default style used is "Solid", but it can be set using the template's second (unnamed) parameter. The icon's color can also be changed using the |color= property.
Example
{{fa|alarm-clock}}
generates:
{{fa|alarm-clock|regular}}
generates:
{{fa|alarm-clock|regular|color=blue}}
generates:
Template Data
Adds a FontAwesome icon
Parameter | Description | Type | Status | |
---|---|---|---|---|
Icon name | 1 | The name of the FA icon, without the "fa-" prefix.
| String | required |
Icon style | 2 | Optional parameter for setting the icon's style. Options are: solid, regular, light, thin, duotone. Solid is the default, and using it is recommended for consistency.
| String | suggested |
Icon color | color | Optional parameter for the icon's color
| String | suggested |
Further styling | style | Optional parameter for setting further CSS styles. | String | suggested |