User:Samatarou/sandbox/contest-winner

Syntax: "Text" is the text to be displayed. The other parameters are optional.

These templates set standard background colours for winners, finalists, semi-finalists, quarter-finalists and round winners in table entries without having to laboriously specify the same styling information over and over. Importantly (unlike simple CSS styling), they meet accessibility guidelines by marking each item with a different icon, so that people who can't see the colours can still distinguish winners from finalists from semi-finalists etc. And for blind people and other text-only displays each icon is automatically replaced by appropriate alt text such as "finalist", "winner" etc. so that the information is still understandable.

Both the colours and accolades given can be customised, eg. you could turn the titles for winner, finalist and semi-finalist into 1st, 2nd and 3rd, and the colours into gold silver and bronze.

To make a legend, simply use the bare templates, as in the absence of supplied text the underlying accolade text is displayed. for instance: produces In actual use, add the desired text such a person's name:

produces

To a text only user (e.g. blind person's screen reader) the above items would be shown as: Winner: Fred Blogs 2nd: Fred Blogs World champion: Fred Blogs

You can also alter the background colour and the accolade given by the alt text (and in legends) by adding second and third parameters. 