diff --git a/packages/grafana-ui/src/components/Toggletip/Toggletip.test.tsx b/packages/grafana-ui/src/components/Toggletip/Toggletip.test.tsx index 0bbe95cf852..ddc49db1c41 100644 --- a/packages/grafana-ui/src/components/Toggletip/Toggletip.test.tsx +++ b/packages/grafana-ui/src/components/Toggletip/Toggletip.test.tsx @@ -2,7 +2,7 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; -import { Button } from '../Button'; +import { Button, LinkButton } from '../Button'; import { Toggletip } from './Toggletip'; @@ -234,4 +234,30 @@ describe('Toggletip', () => { expect(afterButton).toHaveFocus(); }); }); + + it(`should render LinkButtons correctly with no additional styles`, () => { + const identicalProps = { + children: 'Click me!', + href: 'https://grafana.com', + }; + + const outsideLinkButton = ; + const insideLinkButton = ; + + render( + <> + + + + {outsideLinkButton} + + ); + + const outsideButton = screen.getByTestId('outside'); + const insideButton = screen.getByTestId('inside'); + + expect(getComputedStyle(outsideButton).cssText).toStrictEqual(getComputedStyle(insideButton).cssText); + }); }); diff --git a/packages/grafana-ui/src/utils/tooltipUtils.ts b/packages/grafana-ui/src/utils/tooltipUtils.ts index a1eb2dd222a..b666ca85b29 100644 --- a/packages/grafana-ui/src/utils/tooltipUtils.ts +++ b/packages/grafana-ui/src/utils/tooltipUtils.ts @@ -1,7 +1,7 @@ import { css } from '@emotion/css'; import { Placement } from '@floating-ui/react'; -import { colorManipulator, GrafanaTheme2 } from '@grafana/data'; +import { GrafanaTheme2 } from '@grafana/data'; import { TooltipPlacement } from '../components/Tooltip'; @@ -45,28 +45,6 @@ export function buildTooltipTheme( "&[data-popper-interactive='false']": { pointerEvents: 'none', }, - - code: { - border: 'none', - display: 'inline', - background: colorManipulator.darken(tooltipBg, 0.1), - color: tooltipText, - whiteSpace: 'normal', - }, - - pre: { - background: colorManipulator.darken(tooltipBg, 0.1), - color: tooltipText, - }, - - a: { - color: tooltipText, - textDecoration: 'underline', - }, - - 'a:hover': { - textDecoration: 'none', - }, }), headerClose: css({ color: theme.colors.text.secondary,