From 49311e1cfbd84c2ca165e08e2ce5bd59cab4d0ab Mon Sep 17 00:00:00 2001 From: Dominik Prokop Date: Tue, 19 Jul 2022 14:07:27 +0200 Subject: [PATCH] Legend: Right align calculation values (#52400) --- .../grafana-ui/src/components/VizLegend/VizLegendTable.tsx | 4 ++-- .../src/components/VizLegend/VizLegendTableItem.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/grafana-ui/src/components/VizLegend/VizLegendTable.tsx b/packages/grafana-ui/src/components/VizLegend/VizLegendTable.tsx index 06d5666076f..21e786e6cf5 100644 --- a/packages/grafana-ui/src/components/VizLegend/VizLegendTable.tsx +++ b/packages/grafana-ui/src/components/VizLegend/VizLegendTable.tsx @@ -108,9 +108,9 @@ const getStyles = (theme: GrafanaTheme2) => ({ color: ${theme.colors.primary.text}; font-weight: ${theme.typography.fontWeightMedium}; border-bottom: 1px solid ${theme.colors.border.weak}; - padding: ${theme.spacing(0.25, 2, 0.25, 1)}; + padding: ${theme.spacing(0.25, 1, 0.25, 1)}; font-size: ${theme.typography.bodySmall.fontSize}; - text-align: left; + text-align: right; white-space: nowrap; `, // This needs to be padding-right - icon size(xs==12) to avoid jumping diff --git a/packages/grafana-ui/src/components/VizLegend/VizLegendTableItem.tsx b/packages/grafana-ui/src/components/VizLegend/VizLegendTableItem.tsx index 2454ffaf38e..cad8a3d9674 100644 --- a/packages/grafana-ui/src/components/VizLegend/VizLegendTableItem.tsx +++ b/packages/grafana-ui/src/components/VizLegend/VizLegendTableItem.tsx @@ -123,7 +123,7 @@ const getStyles = (theme: GrafanaTheme2) => { align-items: center; `, value: css` - text-align: left; + text-align: right; `, yAxisLabel: css` color: ${theme.colors.text.secondary};