Template:Color box/doc

From D&D Wiki

{{#ifeq:doc |doc

    | 

{{#ifeq:show |show

         | Lua error: Cannot create process: proc_open(/home/bitnami/errors/lua-error.log): failed to open stream: Permission denied
        }}{{#if: |
         |   {{#ifexist:Template:Color box
                  | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
                  |
                 }}
        }}
    | 
   }}

Usage

{{color box|color|text|text color}}

Shortcuts/Redirects:

  • Colors are most commonly specified as either a color keyword or as the hexadecimal triplet representing an RGB combination. See web colors for details.
  • If specified, the text is centered within the box.
  • If no color is specified for the text, it is displayed using the default style foreground color as prescribed by CSS. For most users this is black.
  • The optional parameter |border= will change the color of the outline box. The default is black.
Examples
Visual effect Markup
 {{{2}}} |    }} {{color box|Green}}
 Default color for this text |    }} {{color box|Yellow|Default color for this text}}
 White text in a blue box |    }} {{color box|Blue|White text in a blue box|White}}
 Using X11 color names |    }} {{color box|SteelBlue|'''Using X11 color names'''|Cornsilk}}
 Using RGB hex triplets |    }} {{color box|#012345|''Using RGB hex triplet''|#FEDCBA}}
 Red |    }} {{color box|Yellow|Red|#f00|border=#f00}}

Variants

  • {{Color box}}, a small color box with black borders and text color. (e.g. {{#if:| {{{2}}} |    }} or {{#if:ORANGE| ORANGE |    }} )
  • {{RouteBox}}, a borderless version with text color and wikilinks. (e.g.  {{safesubst:#if:Orange (colour)| ORANGE | ORANGE }} )
  • {{Colorbull}}, a colored bullet with wikilinks. (e.g. {{#if:|{{#if:|[[{{{3}}}|{{#switch:{{{2}}}
 | c|circle|r|round = ●
 | d|diamond = ◆
 | tu|up|uptriangle = ▲
 | td|dn|downtriangle = ▼
 | tl|lt|lefttriangle = ◀
 | tr|rt|righttriangle = ▶
 | #default = ■

}}]]|{{#switch:{{{2}}}

 | c|circle|r|round = ●
 | d|diamond = ◆
 | tu|up|uptriangle = ▲
 | td|dn|downtriangle = ▼
 | tl|lt|lefttriangle = ◀
 | tr|rt|righttriangle = ▶
 | #default = ■

}}}}|■}})

 {{#if: 
 | {{{demospace}}}    
 | {{#ifeq:Template|
   | main
   | other
   }} 
 }}

| main = {{#if:orange|{{#ifexpr:Lua error: Cannot create process: proc_open(/home/bitnami/errors/lua-error.log): failed to open stream: Permission denied < 7 OR Lua error: Cannot create process: proc_open(/home/bitnami/errors/lua-error.log): failed to open stream: Permission denied < 7 AND Lua error: Cannot create process: proc_open(/home/bitnami/errors/lua-error.log): failed to open stream: Permission denied < 7|}}}} | other | #default = }}{{#switch:

 {{#if:
 | {{{demospace}}}    
 | {{#ifeq:Template|Template
   | template
   | other
   }}
 }}

| template = {{#if:orange|{{#ifexpr:Lua error: Cannot create process: proc_open(/home/bitnami/errors/lua-error.log): failed to open stream: Permission denied < 7 OR Lua error: Cannot create process: proc_open(/home/bitnami/errors/lua-error.log): failed to open stream: Permission denied < 7 AND Lua error: Cannot create process: proc_open(/home/bitnami/errors/lua-error.log): failed to open stream: Permission denied < 7|}}}} | other | #default = }})

See also


<templatedata> { "params": { "1": { "label": "Color", "description": "Color of the box.", "example": "Green", "type": "string", "required": true, "suggested": true }, "2": { "label": "Text", "description": "The text in the box.", "example": "Hello, world!", "type": "string", "suggested": true }, "3": { "label": "Text color", "description": "Sets the color of the text inside the box.", "example": "Yellow",

                       "type": "string",

"suggested": true }, "border": { "description": "Adds border outside the box.", "example": "border=#FF0" } }, "description": "Adds a rectangular color box.", "format": "inline" } </templatedata>