Template:Composition bar/doc: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(background-color default correction)
(update for width parameter change (now allows units), new border/border-color parameter)
Line 18: Line 18:
; background-color=...
; background-color=...
: (default is transparent) is the background color of the right part of the bar - a valid [[web colors|web color]].
: (default is transparent) is the background color of the right part of the bar - a valid [[web colors|web color]].
; border=...
: (default is medium grey) is the color of the border, or "none" for no border
; width=...
; width=...
: (default is 100) is the width of the bar in px, only fixed widths in px are supported
: (default is 100px) a width value for the bar, such as "100%" or "8em" (unitless numbers are interpreted as px)
; per=...
; per=...
: (default is false), when set to any value (true), adds a percentage to the bar as well
: (default is false), when set to any value (true), adds a percentage to the bar as well
Line 31: Line 33:
| {{Composition bar|50|100|red}}
| {{Composition bar|50|100|red}}
|-
|-
| style="font-size: 95%"| <code><nowiki>{{Composition bar|50|100|pink|background-color=#333}}</nowiki></code>
| style="font-size: 95%"| <code><nowiki>{{Composition bar|50|100|red|background-color=#DDD|border=none}}</nowiki></code>
| {{Composition bar|50|100|pink|background-color=#333}}
| {{Composition bar|50|100|red|background-color=#DDD|border=none}}
|-
|-
| style="font-size: 95%"| <code><nowiki>{{Composition bar|50|100|#99F}}</nowiki></code>
| style="font-size: 95%"| <code><nowiki>{{Composition bar|50|100|#99F|width=85%}}</nowiki></code>
| {{Composition bar|50|100|#99F}}
| {{Composition bar|50|100|#99F|width=85%}}
|-
|-
| style="font-size: 95%"| <code><nowiki>{{Composition bar|50|100|{{Green Party (UK)/meta/color}}}}</nowiki></code>
| style="font-size: 95%"| <code><nowiki>{{Composition bar|50|100|{{Green Party (UK)/meta/color}}}}</nowiki></code>
Line 78: Line 80:
"label": "3",
"label": "3",
"description": "The background color of the left part of the bar - a valid web color, which can be specified by name, as a hex triplet (#rrbbgg), or rgb triplet (rgb(0–255,0–255,0–255)). In the case of political parties, most will have their logo color available in {{political party/meta/color}} templates.",
"description": "The background color of the left part of the bar - a valid web color, which can be specified by name, as a hex triplet (#rrbbgg), or rgb triplet (rgb(0–255,0–255,0–255)). In the case of political parties, most will have their logo color available in {{political party/meta/color}} templates.",
"default": "#CCC",
"default": "#CCCCCC",
"type": "string/line",
"type": "string/line",
"required": false,
"required": false,
Line 89: Line 91:
"type": "string/line",
"type": "string/line",
"required": false
"required": false
},
"border": {
"label": "Border color",
"description": "The color of the border, or 'none' for no border",
"default": "#AAAAAA",
"type": "string/line",
"required": false,
"aliases": ["border-color"]
},
},
"width": {
"width": {
"label": "Width",
"label": "Width",
"description": "The width of the bar in px (fixed width only, relative widths do not work)",
"description": "The width of the bar with units, such as 100% or 10em (unitless numbers are interpreted as px)",
"default": "100",
"default": "100px",
"type": "string/line",
"type": "string/line",
"required": false
"required": false