Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Color/doc: Difference between revisions

Template page
m alias
m +parm
Line 22: Line 22:
|4stat= optional-
|4stat= optional-


|5    = css  
|5    = style</code> or <code>css  
|5aliases=5
|5aliases=5
|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}}
|5d-en= additional CSS style 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-
|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>400
|6stat= optional-


  |name = {{BASEPAGENAME}}
  |name = {{BASEPAGENAME}}
Line 57: Line 61:


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}} &ensp; or &ensp; <nowiki>{{</nowiki>Color|1=#F0F|2=XX|bg=#F0F}} → {{color|1=#F0F|2=XX|bg=#F0F}} &ensp; or &ensp; the ''short form'' {{Tlx|Cbox|#CCC}} → {{cbox|#ccc}}
* <nowiki>{{</nowiki>Color||<nowiki>{{</nowiki>0|00}}|bg=#0a0}} → {{color||{{0|00}}|bg=#0a0}} &ensp; or &ensp; <nowiki>{{</nowiki>Color|1=#F0F|2=XX|bg=#F0F}} → {{color|1=#F0F|2=XX|bg=#F0F}} &ensp; or &ensp; the ''short form'' {{Tlx|Cbox|#CCC}} → {{cbox|#CCC}}




Line 71: Line 75:


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.
<includeonly>
<includeonly>
[[Category:Colorbox formatting templates| ]]
[[Category:Colorbox formatting templates| ]]
[[Category:Color text formatting templates| ]]
[[Category:Color text formatting templates| ]]
<includeonly>
<includeonly>

Revision as of 09:52, 11 April 2022

  • coloring of text,
  • drawing boxes,
  • tooltipping

Usage

{{Color |2= |style or css= }}

Template parameters

ParameterDescriptionDefaultStatus
1color of the text, in any valid notation, plus
"b" as a short form for "black" (#000000)
"w" as a short form for "white" (#FFFFFF)
redoptional
2text, in any wiki notationemptyrequired
bg
3
color of the background, in any valid notationtransparentoptional
title
4
any text to be tooltipped"bg" valueoptional
style or css
5
additional CSS style attributes, like e.g. border and paddingemptyoptional
b or bold
6
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|#FBBD46|bg=#FBBD46}} → #FBBD46


To draw just a color box with bg-color, use it like

  • {{Color||{{0|00}}|bg=#0a0}} → 00   or   {{Color|1=#F0F|2=XX|bg=#F0F}} → XX   or   the short form {{Cbox|#CCC}} → 00


To just tooltip a text, use it like
The <u>{{color|#000|underlined text|title=tooltip example}}</u> is ''{{W|tooltip}}ped'' : 0 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.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.