Template talk:Composition bar/Archive 1

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

75 / 100

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

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)

Height of the template

@RexxS: or @Technical 13:: Please see the thread at Wikipedia: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)