Skip to content

Commit dafedf8

Browse files
authored
ToolbarSwitch: Fixes internal border radius and other issues (grafana#111432)
1 parent 969eeb1 commit dafedf8

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

public/app/features/dashboard-scene/scene/new-toolbar/actions/ToolbarSwitch.tsx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { css, cx } from '@emotion/css';
22
import { MouseEvent } from 'react';
33

44
import { GrafanaTheme2, IconName } from '@grafana/data';
5-
import { Icon, Tooltip, useStyles2 } from '@grafana/ui';
5+
import { Icon, styleMixins, Tooltip, useStyles2 } from '@grafana/ui';
66

77
interface Props {
88
icon: IconName;
@@ -91,28 +91,18 @@ const getStyles = (theme: GrafanaTheme2) => ({
9191
alignItems: 'center',
9292
justifyContent: 'center',
9393
width: theme.spacing(2.5),
94-
height: theme.spacing(2.5),
95-
borderRadius: theme.shape.radius.default,
94+
height: '100%',
9695
transform: 'translateX(0)',
9796
position: 'relative',
97+
borderRadius: styleMixins.getInternalRadius(theme, 2),
98+
border: `1px solid ${theme.colors.secondary.border}`,
9899

99100
[theme.transitions.handleMotion('no-preference', 'reduce')]: {
100101
transition: 'all 0.2s ease-in-out',
101102
},
102-
103-
'&:after': css({
104-
content: "''",
105-
position: 'absolute',
106-
top: 0,
107-
left: 0,
108-
right: 0,
109-
bottom: 0,
110-
borderRadius: theme.shape.radius.default,
111-
background: theme.colors.secondary.main,
112-
border: `1px solid ${theme.colors.secondary.border}`,
113-
}),
114103
}),
115104
boxChecked: css({
116105
transform: `translateX(calc(100% - ${theme.spacing(0.25)}))`,
106+
borderColor: 'transparent',
117107
}),
118108
});

0 commit comments

Comments
 (0)