跳转到内容

模板:Color-sample/doc

来自天灾之下:危险连接资料站

Shows a color sample box for inline use without accompanying text.

Usage

{{color-sample|background-color|outline=outline color|border=css border}}
  • background-color is passed to the css background-color property of the sample box.
  • The optional outline parameter is the color of the outline around the box.
  • The optional border argument overrides the outline argument and sets the css description (e.g., 1px solid #aaa) of the border that will be drawn around the box.

Examples

  • {{color-sample|black}} →  
  • {{color-sample|green}} →  
  • {{color-sample|blue}} →  
  • {{color-sample|#ffa|outline=silver}} →  
  • {{color-sample|#ff2800|outline=#A2A9B1}} →  

Full parameter list

{{color-example
| [box's colo(u)r]
| outline =  <!--colo(u)r of border around box-->
| border =   <!--use to specify custom CSS styling for border (overrides 'outline')-->
| color =    <!--colo(u)r of 'text'-->
| size =     <!--'text' font-size-->
| text =     <!--to place text inside the box-->
}}

See also

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools.

Color-sample

Shows a color sample box without accompanying text.

模板参数

参数描述类型状态
Color1

The color for the sample box, in any CSS format.

示例值
"#6D6E00", "#ffa", "yellow"
单行文本必需
CSS border styleborder

CSS style for the sample box's border.

字符串可选
Entry outlineoutline

CSS color for the outline of the sample box.

示例值
silver
单行文本可选
Text in the entrytext

Text to be displayed in the sample box, i.e. within the color specified.

示例值
Af
单行文本可选
Text colortextcolor

CSS color of text inside the legend's colored box.

字符串可选
Sizesize

Size of the sample box.

字符串可选