Alerting: Make whitespace more visible on labels (#90223)

This commit is contained in:
Tom Ratcliffe
2024-07-11 17:33:27 +01:00
committed by GitHub
parent d0afa60feb
commit f140594cf1
3 changed files with 6 additions and 2 deletions
@@ -82,7 +82,7 @@ const getTagStyles = (theme: GrafanaTheme2, name: string, colorIndex?: number) =
verticalAlign: 'baseline',
backgroundColor: colors.color,
color: theme.v1.palette.gray98,
whiteSpace: 'nowrap',
whiteSpace: 'pre',
textShadow: 'none',
padding: '3px 6px',
borderRadius: theme.shape.radius.default,
@@ -137,7 +137,7 @@ const getStyles = (theme: GrafanaTheme2, color?: string, size?: string) => {
borderLeft: 'none',
borderTopRightRadius: theme.shape.borderRadius(2),
borderBottomRightRadius: theme.shape.borderRadius(2),
whiteSpace: 'nowrap',
whiteSpace: 'pre',
overflow: 'hidden',
textOverflow: 'ellipsis',
maxWidth: '300px',
@@ -80,6 +80,10 @@ const getStyles = (theme: GrafanaTheme2) => ({
border: `solid 1px ${borderColor}`,
borderRadius: theme.shape.borderRadius(2),
// Ensure we preserve whitespace, as otherwise it's not noticeable _at all_
// when rendering the matcher, and is only noticeable when editing
whiteSpace: 'pre',
}),
};
},