Template:Color/doc: Difference between revisions
More actions
fix italics |
adding, see also: {{ColorRect}} |
||
| (7 intermediate revisions by 3 users not shown) | |||
| Line 2: | Line 2: | ||
{{TemplateBox | {{TemplateBox | ||
|1 = | |1 = | ||
|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) | |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||red}} | |1def = {{color||red}} | ||
|1stat= optional- | |1stat= optional- | ||
| Line 12: | Line 12: | ||
|3 = bg | |3 = bg | ||
|3aliases=3 | |3aliases=3 | ||
|3d-en= color of the background, in any valid notation:<br>CSS color name, #RGB, <s>tincture name</s> | |3d-en= color of the background, in any valid notation:<br />CSS color name, #RGB, <s>tincture name</s> | ||
|3def = transparent | |3def = transparent | ||
|3stat= optional- | |3stat= optional- | ||
| Line 22: | Line 22: | ||
|4stat= optional- | |4stat= optional- | ||
|5 = style | |5 = style or css | ||
|5aliases=5 | |5aliases=5 | ||
|5d-en= additional ''CSS style'' attributes, as e.g. {{C|Valid SVG created with Inkscape:Silk slips|border}} and {{C|Valid SVG created with Inkscape:Kangxi radicals|padding}} | |5d-en= additional ''CSS style'' attributes, as e.g. {{C|Valid SVG created with Inkscape:Silk slips|border}} and {{C|Valid SVG created with Inkscape:Kangxi radicals|padding}} | ||
|6 = b</code> or <code>bold | |6 = b</code> or <code>bold | ||
|6aliases=6 | |6aliases=6 | ||
|6d-en= specification of font-weight: normal/bold (lighter/bolder)<br>or numeric value 100...900 where normal=400 and bold=700[[#Font-weight|{{exp|1}}]] | |6d-en= specification of font-weight: normal/bold (lighter/bolder)<br />or numeric value 100...900 where normal=400 and bold=700[[#Font-weight|{{exp|1}}]] | ||
|6def = normal<br>{{0}}400 | |6def = normal<br />{{0}}400 | ||
|6stat= optional- | |6stat= optional- | ||
| Line 42: | Line 42: | ||
* {{tl|Tincture}} | * {{tl|Tincture}} | ||
* {{Tl|Cbox}} | * {{Tl|Cbox}} | ||
* {{Tl|ColorRect}} | |||
|i18n-method=- | |i18n-method=- | ||
}} | }} | ||
| Line 64: | Line 65: | ||
To just '''''tooltip''''' a text, use it like<br> | To just '''''tooltip''''' a text, use it like<br /> | ||
<nowiki>The <u>{{color|#000|underlined text|title=tooltip example}}</u> is ''{{W|tooltip}}ped'' </nowiki>: {{0}} The <u>{{color|#000|underlined text|title=tooltip example}}</u> is ''{{W|tooltip}}ped''. | <nowiki>The <u>{{color|#000|underlined text|title=tooltip example}}</u> is ''{{W|tooltip}}ped'' </nowiki>: {{0}} The <u>{{color|#000|underlined text|title=tooltip example}}</u> is ''{{W|tooltip}}ped''. | ||
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='''< | <nowiki>{{color|b|'''padded box'''|bg=#CFC|</nowiki>'''css='''<code>border:</code>2px dotted #F80;<code>padding:</code>0 8px|'''title'''=CSS example}} → {{color|b|'''padded box'''|bg=#CFC|css=border:2px dotted #F80;padding:0 8px|title=CSS example}} | ||
| Line 78: | Line 79: | ||
== Font-weight == | == Font-weight == | ||
can be specified either with | can be specified either with | ||
* 6 = b ''sets a font-weight of bold (graduation 700)''<br>6 = bold ''sets a font-weight of bold (graduation 900)'' | * 6 = b ''sets a font-weight of bold (graduation 700)''<br />6 = bold ''sets a font-weight of bold (graduation 900)'' | ||
'''''or''''' with the keyword (parameter name) "b" or "bold" | '''''or''''' with the keyword (parameter name) "b" or "bold" | ||
* b = ''any of the parameter values normal, bold, lighter, bolder, 100, 200, ... 900'' | * b = ''any of the parameter values normal, bold, lighter, bolder, 100, 200, ... 900'' | ||
The specifications <code>6=b</code>, <code>b=bold</code>, <code>bold=bold</code>, <code>b=700</code>, <code>bold=700</code> are equivalent;<br>it can as well be specified with <code>style=font-weigth:bold</code> or <code>css=font-weight:700</code>. | The specifications <code>6=b</code>, <code>b=bold</code>, <code>bold=bold</code>, <code>b=700</code>, <code>bold=700</code> are equivalent;<br />it can as well be specified with <code>style=font-weigth:bold</code> or <code>css=font-weight:700</code>. | ||
<includeonly> | <includeonly> | ||
[[Category:Colorbox formatting templates| ]] | [[Category:Colorbox formatting templates| ]] | ||
[[Category:Color text formatting templates| ]] | [[Category:Color text formatting templates| ]] | ||
<includeonly> | <includeonly> | ||
Latest revision as of 23:57, 11 July 2025
- coloring of text,
- drawing boxes,
- tooltipping
Usage
{{Color |2= |style or css= }}
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 | |
bg3 | color of the background, in any valid notation: CSS color name, #RGB, | transparent | optional | |
title4 | any text to be tooltipped | "bg" value | optional | |
style or css5 | additional CSS style attributes, as e.g. border and padding | empty | optional | |
b or bold6 | specification of font-weight: normal/bold (lighter/bolder) or numeric value 100...900 where normal=400 and bold=7001 | normal 400 | 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
Localization
This template is not intended to be localized.
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
- {{color|b|{{0}}#FBBD46{{0}}|bg=#FBBD46}} → #FBBD46
To draw just a color box with bg-color, use it like
- {{Color|1=#F0F|2=XX|bg=#F0F}} → XX or {{Color||{{0|00}}|bg=#0a0}} → or the shortest 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
Font-weight
can be specified either with
- 6 = b sets a font-weight of bold (graduation 700)
6 = bold sets a font-weight of bold (graduation 900)
or with the keyword (parameter name) "b" or "bold"
- b = any of the parameter values normal, bold, lighter, bolder, 100, 200, ... 900
The specifications 6=b, b=bold, bold=bold, b=700, bold=700 are equivalent;
it can as well be specified with style=font-weigth:bold or css=font-weight:700.