Revision as of 22:55, 24 December 2013 editPigsonthewing (talk | contribs)Autopatrolled, Event coordinators, Extended confirmed users, Page movers, File movers, IP block exemptions, New page reviewers, Pending changes reviewers, Rollbackers, Template editors266,093 edits →Accessibility: ty← Previous edit | Latest revision as of 21:15, 27 March 2023 edit undoZinnober9 (talk | contribs)Extended confirmed users, Pending changes reviewers51,294 editsm Fixed Lint errors on this page (obsolete tags) | ||
(7 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{aan}} | |||
== Combine == | == Combine == | ||
Can we work out something that shows all of the political parties' colors all in one bar? –''']''' (]) 16:56, 21 October 2010 (UTC) | Can we work out something that shows all of the political parties' colors all in one bar? –''']''' (]) 16:56, 21 October 2010 (UTC) | ||
== Text color == | == Text color == | ||
Line 7: | Line 9: | ||
I suggest we change the code to the following: | I suggest we change the code to the following: | ||
< |
<code><nowiki> | ||
<div style="border-style:solid;border-width:1px;border-color:#c0c0c0;background-color:#f0f0f0;width:100px;height:1.5em;"><div style="position: absolute; background-color:{{#if:{{both|{{{4|}}}|{{{5|}}}}} | <div style="border-style:solid;border-width:1px;border-color:#c0c0c0;background-color:#f0f0f0;width:100px;height:1.5em;"><div style="position: absolute; background-color:{{#if:{{both|{{{4|}}}|{{{5|}}}}} | ||
Line 13: | Line 15: | ||
|{{{hex|{{{3|#CCCCCC}}}}}} }};width:{{#expr:floor(100*{{{1|50}}}/{{{2|100}}})}}px;height:1.5em;"></div><div style="position: absolute; font-weight:bold;width:100px;height:1.5em;text-align:center;z-index: 10;color:{{{text-color|#000000}}};">{{formatnum:{{{1|50}}}}} / {{formatnum:{{{2|100}}}}}</div></div> | |{{{hex|{{{3|#CCCCCC}}}}}} }};width:{{#expr:floor(100*{{{1|50}}}/{{{2|100}}})}}px;height:1.5em;"></div><div style="position: absolute; font-weight:bold;width:100px;height:1.5em;text-align:center;z-index: 10;color:{{{text-color|#000000}}};">{{formatnum:{{{1|50}}}}} / {{formatnum:{{{2|100}}}}}</div></div> | ||
</nowiki></ |
</nowiki></code> | ||
in which an extra parameter |
in which an extra parameter {{mono|text-color}} can be used to change the color of the numbers (e.g. in case the party's color is black). | ||
E.g.: < |
E.g.: <code><nowiki>{{Infobox political party/seats|75|100|black|text-color=white}}</nowiki></code> which gives {{User:Abjiklam/seats|75|100|black|text-color=white}} | ||
If there is no objection I can make the change myself. — <small>] (''] '''·''' ]'')</small> 15:51, 15 March 2012 (UTC) | If there is no objection I can make the change myself. — <small>] (''] '''·''' ]'')</small> 15:51, 15 March 2012 (UTC) | ||
* {{Done}} ] (]) 12:10, 17 December 2013 (UTC) | * {{Done}} ] (]) 12:10, 17 December 2013 (UTC) | ||
Line 25: | Line 27: | ||
The use of black text on some of the coloured backgrounds used by this template (e.g. #DC241F red for the (British) Labour Party on ]) do not have sufficient levels of contrast to satisfy ] or ]. As such, they present a barrier to readers with some forms of colour blindness, or other sight impairments. How might we improve the template to address this? <span class="vcard"><span class="fn">]</span> (<span class="nickname">Pigsonthewing</span>); ]; ]</span> 11:21, 17 December 2013 (UTC) | The use of black text on some of the coloured backgrounds used by this template (e.g. #DC241F red for the (British) Labour Party on ]) do not have sufficient levels of contrast to satisfy ] or ]. As such, they present a barrier to readers with some forms of colour blindness, or other sight impairments. How might we improve the template to address this? <span class="vcard"><span class="fn">]</span> (<span class="nickname">Pigsonthewing</span>); ]; ]</span> 11:21, 17 December 2013 (UTC) | ||
:The colors that people choose to use with this template have nothing to do with the coding of the template. I suggest leaving a friendly note on the talk page of the user who picked the offending color that caused the issue pointing them to ] or ] and asking them to fix the issue. As you can see in the above section, it is already possible to select background, border, and text color, so there is nothing more that needs to be done to the template on this front. ] (]) 12:10, 17 December 2013 (UTC) | :The colors that people choose to use with this template have nothing to do with the coding of the template. I suggest leaving a friendly note on the talk page of the user who picked the offending color that caused the issue pointing them to ] or ] and asking them to fix the issue. As you can see in the above section, it is already possible to select background, border, and text color, so there is nothing more that needs to be done to the template on this front. ] (]) 12:10, 17 December 2013 (UTC) | ||
::The colour is not chosen by the editor concerned, but is itself in a subtemplate, in this case, {{tl|Labour Party (UK) |
::The colour is not chosen by the editor concerned, but is itself in a subtemplate, in this case, {{party color|tl|Labour Party (UK)}}. Perhaps it is this template's documentation which needs to be improved? <span class="vcard"><span class="fn">]</span> (<span class="nickname">Pigsonthewing</span>); ]; ]</span> 12:59, 17 December 2013 (UTC) | ||
::: The choice to use {{tl|Labour Party (UK) |
::: The choice to use {{party color|tl|Labour Party (UK)}} is made by the user. Either way, the issue is not with {{Tl|Composition bar}}, it is with the parameters passed to it. I suggest requesting a change on {{party color|tl|Labour Party (UK)}}'s talk page. I can update the documentation for this template however since there are some undocumented parameters (which I just added). ] (]) 13:09, 17 December 2013 (UTC) | ||
::::The use of party colour subtemplates is mandated in this template's documentation. The colours in those templates are matched to the colours used by the parties themselves. Also, the {{para|text-color}} shown above isn't documented, doesn't appear in the template markup, and apparently doesn't work, as can be seen at ], where I have just tried to use it. <span class="vcard"><span class="fn">]</span> (<span class="nickname">Pigsonthewing</span>); ]; ]</span> 13:12, 17 December 2013 (UTC) | ::::The use of party colour subtemplates is mandated in this template's documentation. The colours in those templates are matched to the colours used by the parties themselves. Also, the {{para|text-color}} shown above isn't documented, doesn't appear in the template markup, and apparently doesn't work, as can be seen at ], where I have just tried to use it. <span class="vcard"><span class="fn">]</span> (<span class="nickname">Pigsonthewing</span>); ]; ]</span> 13:12, 17 December 2013 (UTC) | ||
:::::It's {{para|color}}, not {{para|text-color}}; but that isn't documented either. --] (]) 13:28, 17 December 2013 (UTC) | :::::It's {{para|color}}, not {{para|text-color}}; but that isn't documented either. --] (]) 13:28, 17 December 2013 (UTC) | ||
::::::Just noticed that it has its own problems: {{Composition bar|77|120|hex={{Labour Party (UK) |
::::::Just noticed that it has its own problems: {{Composition bar|77|120|hex={{party color|Labour Party (UK)}}|color=white}} For me, the zero of 120 is almost invisible, the white on grey having a much worse contrast than black on red. --] (]) 13:54, 17 December 2013 (UTC) | ||
::::::: could be fixable by adding a background to the text, independent of the color of the bar. something like {{Composition bar/sandbox|77|120|hex={{Labour Party (UK) |
::::::: could be fixable by adding a background to the text, independent of the color of the bar. something like {{Composition bar/sandbox|77|120|hex={{party color|Labour Party (UK)}}}}, but with less padding. ] (]) 20:29, 17 December 2013 (UTC) | ||
::::::: or just by changing the background that isn't red... {{Composition bar|77|120|hex={{Labour Party (UK) |
::::::: or just by changing the background that isn't red... {{Composition bar|77|120|hex={{party color|Labour Party (UK)}}|color=white|background-color=black}} | ||
All the parameters are there, the user just needs to find to correct balance... ] (]) 20:43, 17 December 2013 (UTC) | All the parameters are there, the user just needs to find to correct balance... ] (]) 20:43, 17 December 2013 (UTC) | ||
: I've added a little to the documentation to help them in that task. Please correct any errors you may find. Cheers --] (]) 22:31, 17 December 2013 (UTC) | : I've added a little to the documentation to help them in that task. Please correct any errors you may find. Cheers --] (]) 22:31, 17 December 2013 (UTC) | ||
:: Thanks {{U|RexxS|Rex}}, I was going to do that tonight but what you've done is fine. Not sure if there needs to be documentation for {{Para|border-width}} and {{Para|border-color}} and if someone asks about it I'll add it later. Also should add the VE box for this as well at some point... ] (]) 00:19, 18 December 2013 (UTC) | :: Thanks {{U|RexxS|Rex}}, I was going to do that tonight but what you've done is fine. Not sure if there needs to be documentation for {{Para|border-width}} and {{Para|border-color}} and if someone asks about it I'll add it later. Also should add the VE box for this as well at some point... ] (]) 00:19, 18 December 2013 (UTC) | ||
:: Great work, Rex, thank you. <span class="vcard"><span class="fn">]</span> (<span class="nickname">Pigsonthewing</span>); ]; ]</span> 22:55, 24 December 2013 (UTC) | :: Great work, Rex, thank you. <span class="vcard"><span class="fn">]</span> (<span class="nickname">Pigsonthewing</span>); ]; ]</span> 22:55, 24 December 2013 (UTC) | ||
== Height of the template == | |||
{{ping|RexxS}} or {{ping|Technical 13}}: Please see the thread at ]. The problem seems to be that the composition bar template is a bit too tall to fit nicely onto the <code>| seats1 = </code> line of the {{tl|Infobox political party}} template. Can this be tweekd a bit to fit better into the info box? Thanks, -- ] (]) 18:33, 10 January 2015 (UTC) | |||
:I restored a prior copy of the previous template, {{tl|Infobox political party/seats}}, so it doesn't affect the non Infobox political party/seats, and set the height to 1.0 <small>]</small> 22:24, 10 January 2015 (UTC) | |||
::Thank you. The specific case the user was looking at, ], is now nicely aligned. -- ] (]) 22:50, 10 January 2015 (UTC) |
Latest revision as of 21:15, 27 March 2023
This is an archive of past discussions about Template:Composition bar. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 |
Combine
Can we work out something that shows all of the political parties' colors all in one bar? –HTD (ITN: Where no updates but is stickied happens.) 16:56, 21 October 2010 (UTC)
Text color
I suggest we change the code to the following:
<div style="border-style:solid;border-width:1px;border-color:#c0c0c0;background-color:#f0f0f0;width:100px;height:1.5em;"><div style="position: absolute; background-color:{{#if:{{both|{{{4|}}}|{{{5|}}}}}
|rgb({{#expr:255*{{{3|255}}}}},{{#expr:255*{{{4|0}}}}},{{#expr:255*{{{5|0}}}}})
|{{{hex|{{{3|#CCCCCC}}}}}} }};width:{{#expr:floor(100*{{{1|50}}}/{{{2|100}}})}}px;height:1.5em;"></div><div style="position: absolute; font-weight:bold;width:100px;height:1.5em;text-align:center;z-index: 10;color:{{{text-color|#000000}}};">{{formatnum:{{{1|50}}}}} / {{formatnum:{{{2|100}}}}}</div></div>
in which an extra parameter text-color can be used to change the color of the numbers (e.g. in case the party's color is black).
E.g.: {{Infobox political party/seats|75|100|black|text-color=white}}
which gives
If there is no objection I can make the change myself. — ABJIKLAM (t · c) 15:51, 15 March 2012 (UTC)
Accessibility
The use of black text on some of the coloured backgrounds used by this template (e.g. #DC241F red for the (British) Labour Party on Birmingham City Council) do not have sufficient levels of contrast to satisfy MOS:COLOUR or International standard web accessibility guidelines. As such, they present a barrier to readers with some forms of colour blindness, or other sight impairments. How might we improve the template to address this? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 11:21, 17 December 2013 (UTC)
- The colors that people choose to use with this template have nothing to do with the coding of the template. I suggest leaving a friendly note on the talk page of the user who picked the offending color that caused the issue pointing them to MOS:COLOUR or International standard web accessibility guidelines and asking them to fix the issue. As you can see in the above section, it is already possible to select background, border, and text color, so there is nothing more that needs to be done to the template on this front. Technical 13 (talk) 12:10, 17 December 2013 (UTC)
- The colour is not chosen by the editor concerned, but is itself in a subtemplate, in this case, #F8F9FA. Perhaps it is this template's documentation which needs to be improved? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 12:59, 17 December 2013 (UTC)
- The choice to use #F8F9FA is made by the user. Either way, the issue is not with {{Composition bar}}, it is with the parameters passed to it. I suggest requesting a change on #F8F9FA's talk page. I can update the documentation for this template however since there are some undocumented parameters (which I just added). Technical 13 (talk) 13:09, 17 December 2013 (UTC)
- The use of party colour subtemplates is mandated in this template's documentation. The colours in those templates are matched to the colours used by the parties themselves. Also, the
|text-color=
shown above isn't documented, doesn't appear in the template markup, and apparently doesn't work, as can be seen at Birmingham City Council, where I have just tried to use it. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:12, 17 December 2013 (UTC)- It's
|color=
, not|text-color=
; but that isn't documented either. --Redrose64 (talk) 13:28, 17 December 2013 (UTC)- Just noticed that it has its own problems: 77 / 120 For me, the zero of 120 is almost invisible, the white on grey having a much worse contrast than black on red. --Redrose64 (talk) 13:54, 17 December 2013 (UTC)
- could be fixable by adding a background to the text, independent of the color of the bar. something like 77 / 120, but with less padding. Frietjes (talk) 20:29, 17 December 2013 (UTC)
- or just by changing the background that isn't red... 77 / 120
- Just noticed that it has its own problems: 77 / 120 For me, the zero of 120 is almost invisible, the white on grey having a much worse contrast than black on red. --Redrose64 (talk) 13:54, 17 December 2013 (UTC)
- It's
- The use of party colour subtemplates is mandated in this template's documentation. The colours in those templates are matched to the colours used by the parties themselves. Also, the
- The choice to use #F8F9FA is made by the user. Either way, the issue is not with {{Composition bar}}, it is with the parameters passed to it. I suggest requesting a change on #F8F9FA's talk page. I can update the documentation for this template however since there are some undocumented parameters (which I just added). Technical 13 (talk) 13:09, 17 December 2013 (UTC)
- The colour is not chosen by the editor concerned, but is itself in a subtemplate, in this case, #F8F9FA. Perhaps it is this template's documentation which needs to be improved? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 12:59, 17 December 2013 (UTC)
All the parameters are there, the user just needs to find to correct balance... Technical 13 (talk) 20:43, 17 December 2013 (UTC)
- I've added a little to the documentation to help them in that task. Please correct any errors you may find. Cheers --RexxS (talk) 22:31, 17 December 2013 (UTC)
- Thanks Rex, I was going to do that tonight but what you've done is fine. Not sure if there needs to be documentation for
|border-width=
and|border-color=
and if someone asks about it I'll add it later. Also should add the VE box for this as well at some point... Technical 13 (talk) 00:19, 18 December 2013 (UTC) - Great work, Rex, thank you. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 22:55, 24 December 2013 (UTC)
- Thanks Rex, I was going to do that tonight but what you've done is fine. Not sure if there needs to be documentation for
Height of the template
@RexxS: or @Technical 13:: Please see the thread at Misplaced Pages:Administrators' noticeboard/Incidents#Redrose64 is stalking me over "forumshopping". The problem seems to be that the composition bar template is a bit too tall to fit nicely onto the | seats1 =
line of the {{Infobox political party}} template. Can this be tweekd a bit to fit better into the info box? Thanks, -- Diannaa (talk) 18:33, 10 January 2015 (UTC)
- I restored a prior copy of the previous template, {{Infobox political party/seats}}, so it doesn't affect the non Infobox political party/seats, and set the height to 1.0 NE Ent 22:24, 10 January 2015 (UTC)
- Thank you. The specific case the user was looking at, Party of the Swedes, is now nicely aligned. -- Diannaa (talk) 22:50, 10 January 2015 (UTC)