Template:Color/doc: Difference between revisions
Template page
More actions
+sa, -intw |
adding, see also: {{ColorRect}} |
||
| (21 intermediate revisions by 9 users not shown) | |||
| Line 1: | Line 1: | ||
{{Heavily used template|3=+}}{{Lua|Module:String}} | |||
{{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 10: | Line 11: | ||
|3 = bg | |3 = bg | ||
|3d-en= color of the background, in any valid notation | |3aliases=3 | ||
|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- | ||
|4 = title | |4 = title | ||
|4aliases=4 | |||
|4d-en= any text to be tooltipped | |4d-en= any text to be tooltipped | ||
|4def = "bg" value | |4def = "bg" value | ||
|4stat= optional- | |4stat= optional- | ||
|5 = css | |5 = style or css | ||
|5d-en= additional CSS attributes | |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}} | ||
|6 = b</code> or <code>bold | |||
|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}}]] | |||
|6def = normal<br />{{0}}400 | |||
|6stat= optional- | |||
|name = {{BASEPAGENAME}} | |name = {{BASEPAGENAME}} | ||
| Line 32: | Line 41: | ||
|seealso = | |seealso = | ||
* {{tl|Tincture}} | * {{tl|Tincture}} | ||
* {{Tl|Cbox}} | |||
* {{Tl|ColorRect}} | |||
|i18n-method=- | |||
}} | }} | ||
---- | ---- | ||
'''Usage:''' <nowiki>{{</nowiki> | '''Usage:''' <nowiki>{{</nowiki>Color|''color''|''text''}} | ||
'''Examples:''' | '''Examples:''' | ||
| Line 43: | Line 55: | ||
* <nowiki>{{color|#000|box ''without'' tooltip|css=border:1px solid #7F7|title=}}</nowiki> → {{color|#000|box ''without'' tooltip|css=border:1px solid #7F7|title=}} | * <nowiki>{{color|#000|box ''without'' tooltip|css=border:1px solid #7F7|title=}}</nowiki> → {{color|#000|box ''without'' tooltip|css=border:1px solid #7F7|title=}} | ||
'''Short | '''Short forms:''' | ||
* <nowiki>{{</nowiki>color||default color|bg=cyan}} → {{color||default color|bg=cyan}} | * <nowiki>{{</nowiki>color||default color|bg=cyan}} → {{color||default color|bg=cyan}} | ||
* <nowiki>{{</nowiki>color|b|black color|bg=gold}} → {{color|b|black color|bg=gold}} | * <nowiki>{{</nowiki>color|b|black color|bg=gold}} → {{color|b|black color|bg=gold}} | ||
* <nowiki>{{</nowiki>color|w|white color|bg=purple}} → {{color|w|white color|bg=purple}} | * <nowiki>{{</nowiki>color|w|white color|bg=purple}} → {{color|w|white color|bg=purple}} | ||
* <nowiki>{{color|b|{{0}}#FBBD46{{0}}|bg=#FBBD46}}</nowiki> → {{color|b|{{0}}#FBBD46{{0}}|bg=#FBBD46}} | |||
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|1=#F0F|2=XX|bg=#F0F}} → {{color|1=#F0F|2=XX|bg=#F0F}}   or   <nowiki>{{</nowiki>Color||<nowiki>{{</nowiki>0|00}}|bg=#0a0}} → {{color||{{0|00}}|bg=#0a0}}   or   the ''shortest form'' {{Tlx|Cbox|#CCC}} → {{cbox|#CCC}} | ||
* <nowiki>{{</nowiki>Color|| | |||
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='''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='''<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 64: | Line 76: | ||
The {{color|black|''bg''-color|title=background-color-tooltipping}} is {{W|Tooltip|''tooltipped''}} — move the cursor to the field to see | The {{color|black|''bg''-color|title=background-color-tooltipping}} is {{W|Tooltip|''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)''<br />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 <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:Color text formatting templates| ]] | [[Category:Color text formatting templates| ]] | ||
<includeonly> | <includeonly> | ||