Template:Color/doc: Difference between revisions
More actions
mNo edit summary |
m +link |
||
| Line 20: | Line 20: | ||
|5 = css | |5 = css | ||
|5d-en= additional CSS attributes | |5d-en= additional CSS attributes, like e.g. {{C|Valid SVG created with Inkscape:Silk slips|border}} and {{C|Valid SVG created with Inkscape:Kangxi radicals|padding}} | ||
|5stat= optional- | |5stat= optional- | ||
| Line 35: | Line 36: | ||
---- | ---- | ||
'''Usage:''' <nowiki>{{</nowiki> | '''Usage:''' <nowiki>{{</nowiki>Color|''color''|''text''}} | ||
'''Examples:''' | '''Examples:''' | ||
| Line 50: | Line 51: | ||
To draw just a ''color '''box''''' with ''bg''-color, use it like | To draw just a ''color '''box''''' with ''bg''-color, use it like | ||
* <nowiki>{{</nowiki>Color||<nowiki>{{</nowiki>0|00}}|bg=#0a0}} → {{color||{{0|00}}|bg=#0a0}}   or   <nowiki>{{</nowiki>Color|1=#F0F|2=XX|bg=#F0F}} → {{color|1=#F0F|2=XX|bg=#F0F}}   or   {{Tlx|Cbox|#CCC}} → {{cbox|#ccc}} | * <nowiki>{{</nowiki>Color||<nowiki>{{</nowiki>0|00}}|bg=#0a0}} → {{color||{{0|00}}|bg=#0a0}}   or   <nowiki>{{</nowiki>Color|1=#F0F|2=XX|bg=#F0F}} → {{color|1=#F0F|2=XX|bg=#F0F}}   or   the ''short form'' {{Tlx|Cbox|#CCC}} → {{cbox|#ccc}} | ||
| Line 58: | Line 59: | ||
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|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}} | <nowiki>{{color|b|'''padded box'''|bg=#CFC|</nowiki>'''css='''<tt>border:</tt>2px dotted #F80;<tt>padding:</tt>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 06:28, 3 September 2018
- 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, like e.g. border and padding | 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
See also
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 forms:
- {{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 the short form {{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