Template:Color/doc: Difference between revisions
More actions
m +expl |
m +expl |
||
| Line 1: | Line 1: | ||
{{TemplateBox | {{TemplateBox | ||
|1 = | |1 = | ||
|1d-en= color of the text, in any notation<br>"'''b'''" as a short form for "black" (# | |1d-en= color of the text, in any valid notation, plus<br>"'''b'''" as a short form for "black" (#000000)<br>"'''w'''" as a short form for "white" (#FFFFFF) | ||
|1def = {{color| | |1def = {{color||red}} | ||
|1stat= optional- | |1stat= optional- | ||
|2 = | |2 = | ||
|2d-en= text, in any notation | |2d-en= text, in any wiki notation | ||
|2stat= required | |2stat= required | ||
|3 = bg | |3 = bg | ||
|3d-en= color of the background, in any notation | |3d-en= color of the background, in any valid notation | ||
|3def = transparent | |3def = transparent | ||
|3stat= optional- | |3stat= optional- | ||
| Line 27: | Line 27: | ||
*drawing boxes, | *drawing boxes, | ||
*tooltipping | *tooltipping | ||
|namespace = | |namespace = all | ||
|usergroup = | |usergroup = all | ||
|placement = inline | |placement = <!--inline--> | ||
}} | }} | ||
| Line 56: | Line 56: | ||
It is also possible to define ''additional CSS data'', e.g.<br> | It is also possible to define ''additional CSS data'', e.g.<br> | ||
<nowiki>{{color| | <nowiki>{{color|b|'''padded box'''|bg=#CFC|</nowiki>'''css='''border:2px dotted #F80;padding:0 8px|'''title'''=CSS example}} → {{color|b|'''padded box'''|bg=#CFC|css=border:2px dotted #F80;padding:0 8px|title=CSS example}} | ||
Revision as of 07:03, 21 May 2014
- coloring of text,
- drawing boxes,
- tooltipping
Usage
{{Color |2= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | color of the text, in any valid notation, plus "b" as a short form for "black" (#000000) "w" as a short form for "white" (#FFFFFF) | red | optional | |
2 | text, in any wiki notation | empty | required | |
bg | color of the background, in any valid notation | transparent | optional | |
title | any text to be tooltipped | "bg" value | optional | |
css | additional CSS attributes | empty | optional | |
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
Usage: {{color|color|text}}
Examples:
- {{color|red|example text}} → example text
- {{color|#00F|example text}} → example text
- {{color|white|example text|bg=black}} → example text
- {{color|#000|box ''without'' tooltip|css=border:1px solid #7F7|title=}} → box without tooltip
Short formes:
- {{color||default color|bg=cyan}} → default color
- {{color|b|black color|bg=gold}} → black color
- {{color|w|white color|bg=purple}} → white color
To draw just a color box with bg-color use it like
- {{Color||{{0|00}}|bg=#0a0}} → or {{Color|1=#F0F|2=XX|bg=#F0F}} → XX or {{Cbox|#CCC}} →
To just tooltip a text use it like
The <u>{{color|#000|underlined text|title=tooltip example}}</u> is ''{{W|tooltip}}ped'' : The underlined text is tooltipped.
It is also possible to define additional CSS data, e.g.
{{color|b|'''padded box'''|bg=#CFC|css=border:2px dotted #F80;padding:0 8px|title=CSS example}} → padded box
For colors see: Web colors. Three-digit hexadecimal color tables are shown there.
The bg-color is tooltipped — move the cursor to the field to see