From 519f37cd142662af48f2bb4618f6a481233a2647 Mon Sep 17 00:00:00 2001 From: Xaver Maierhofer Date: Tue, 31 Oct 2017 10:16:04 +0100 Subject: [PATCH] [BUGFIX] Calc width for proportion bars --- lib/proportions.js | 5 ++--- scss/modules/_proportion.scss | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/proportions.js b/lib/proportions.js index 260a761..1a54987 100644 --- a/lib/proportions.js +++ b/lib/proportions.js @@ -64,9 +64,8 @@ define(['d3-interpolate', 'snabbdom', 'filters/genericnode', 'helper'], var th = V.h('th', a); var td = V.h('td', V.h('span', { style: { - width: Math.round(v * 100) + '%', - backgroundColor: scale(v), - color: 'white' + width: 'calc(25px + ' + Math.round(v * 90) + '%)', + backgroundColor: scale(v) } }, d[1].toFixed(0))); diff --git a/scss/modules/_proportion.scss b/scss/modules/_proportion.scss index a057c49..754dde8 100644 --- a/scss/modules/_proportion.scss +++ b/scss/modules/_proportion.scss @@ -16,6 +16,7 @@ span { box-sizing: border-box; + color: $color-white; display: inline-block; font-weight: bold; min-width: 1.5em;