Template:Composition bar: Difference between revisions

sync from sandbox: single-line format with text-shadow, width=100% and no border default
(per talk page, support for percentages which round to 0)
(sync from sandbox: single-line format with text-shadow, width=100% and no border default)
Line 1:
<div role="img" class="nowrap" style="display: inline-block; position: relative; vertical-align: top; {{#ifeq:{{{width|}}}|auto||width: {{{width|100%}}};}} text-shadow: 0 0 0.2em {{{text-shadow|#000}}}; color: {{{color|#fff}}}; font-weight: bold;"><!--
<div style="width: {{{width|100}}}px;"><span class="nowrap">{{formatnum:{{{1|50}}}}} / {{formatnum:{{{2|100}}}}}{{#if:{{{per|}}}|&emsp;({{#expr:(({{{1|50}}}/{{{2|100}}})*100) round (-1*{{min|0|{{Order of magnitude|{{#expr:({{{1|50}}}/{{{2|100}}})*100}}}}}}) }}%)}}</span><div style="border: 1px solid #aaa; {{#if:{{{background-color|}}}|background-color: {{{background-color}}};}} height: 1em; position: relative;"><div style="background-color: {{#if:{{Both|{{{4|}}}|{{{5|}}}}}
--><div style="position: absolute; {{#if:{{{border-color|}}}|box-sizing: border-box; border: 1px solid {{{border-color|}}};}} width: 100%; height: 100%; background-color: {{{background-color|#999}}};"><!--
| rgb({{#expr:255*{{{3|255}}}}}, {{#expr:255*{{{4|0}}}}}, {{#expr:255*{{{5|0}}}}})
--><div style="background-color:{{#if:{{both|{{{4|}}}|{{{5|}}}}}
| {{{hex|{{{3|#CCCCCC}}}}}}
}}; width: |rgb({{#expr:((255*{{{13|50255}}}/{{{2|100}}})*100) round (-1*{{min|0|{{Order of magnitude|,{{#expr:(255*{{{14|500}}}}}/,{{#expr:255*{{{25|100}}})*100}0}}}}}) }}%; height: 1em;"></div></div></div><noinclude>
| |{{{hex|{{{3|#CCCCCC333}}}}}}
{{Documentation}}</noinclude>
}}; width: {{#expr:{{{1|50}}}/{{{2|100}}}*100}}%; height: 100%;"><!--
--></div><!--
--></div><!--
--><span style="position: relative; margin: 0 0.3em;"><!--
-->{{formatnum:{{{1|50}}}}} / {{formatnum:{{{2|100}}}}}<!--
--></span><!--
-->{{#if:{{{per|}}}|
<span style="position: relative; margin: 0 0.3em; {{{perstyle|}}}"><!--
-->({{#expr:(({{{1|50}}}/{{{2|100}}})*100)round (-1*{{min|0|{{Order of magnitude|{{#expr:({{{1|50}}}/{{{2|100}}})*100}}}}}}) }}%)<!--
--></span>
}}<!--
--></div><noinclude>
{{Documentation}}</noinclude>
</noinclude>