diff --git a/packages/grafana-data/src/themes/createComponents.ts b/packages/grafana-data/src/themes/createComponents.ts index 54af55d55bc..314b9ba218e 100644 --- a/packages/grafana-data/src/themes/createComponents.ts +++ b/packages/grafana-data/src/themes/createComponents.ts @@ -36,6 +36,10 @@ export interface ThemeComponents { background: string; padding: number; }; + textHighlight: { + background: string; + text: string; + }; sidemenu: { width: number; }; @@ -91,6 +95,10 @@ export function createComponents(colors: ThemeColors, shadows: ThemeShadows): Th menuTabs: { height: 41, }, + textHighlight: { + text: colors.warning.contrastText, + background: colors.warning.main, + }, horizontalDrawer: { defaultHeight: 400, }, diff --git a/packages/grafana-ui/src/components/BrowserLabel/Label.tsx b/packages/grafana-ui/src/components/BrowserLabel/Label.tsx index fb4c77592d5..b184e1a0b90 100644 --- a/packages/grafana-ui/src/components/BrowserLabel/Label.tsx +++ b/packages/grafana-ui/src/components/BrowserLabel/Label.tsx @@ -139,8 +139,8 @@ const getLabelStyles = (theme: GrafanaTheme2) => ({ `, matchHighLight: css` background: inherit; - color: ${theme.colors.primary.text}; - background-color: ${theme.colors.primary.transparent}; + color: ${theme.components.textHighlight.text}; + background-color: ${theme.components.textHighlight.background}; `, hidden: css` opacity: 0.6; diff --git a/packages/grafana-ui/src/components/Logs/LogRowMessage.tsx b/packages/grafana-ui/src/components/Logs/LogRowMessage.tsx index 7a8e8694245..a1a328eb045 100644 --- a/packages/grafana-ui/src/components/Logs/LogRowMessage.tsx +++ b/packages/grafana-ui/src/components/Logs/LogRowMessage.tsx @@ -120,8 +120,6 @@ class UnThemedLogRowMessage extends PureComponent { const style = getLogRowStyles(theme, row.logLevel); const { hasAnsi, raw } = row; const restructuredEntry = restructureLog(raw, prettifyLogMessage); - - const highlightClassName = cx([style.logsRowMatchHighLight]); const styles = getStyles(theme); return ( @@ -145,7 +143,7 @@ class UnThemedLogRowMessage extends PureComponent { /> )} - {renderLogMessage(hasAnsi, restructuredEntry, row.searchWords, highlightClassName)} + {renderLogMessage(hasAnsi, restructuredEntry, row.searchWords, style.logsRowMatchHighLight)} {showContextToggle?.(row) && ( ({ label: select__match-highlight; background: inherit; padding: inherit; - color: ${theme.colors.warning.main}; - background-color: rgba(${theme.colors.warning.main}, 0.1); + color: ${theme.colors.warning.contrastText}; + background-color: ${theme.colors.warning.main}; `, }); diff --git a/public/sass/base/_type.scss b/public/sass/base/_type.scss index ddb83d9e5fe..6de92879bc3 100644 --- a/public/sass/base/_type.scss +++ b/public/sass/base/_type.scss @@ -260,12 +260,6 @@ a.external-link { white-space: nowrap; } -.highlight-search-match { - background: transparent; - color: $yellow; - padding: 0; -} - th { font-weight: $font-weight-semi-bold; }