Skip to content

Commit 5bd075c

Browse files
authored
[Discover] Fix font size in a single document/flyover popover (elastic#226259)
## Summary Closes elastic#226217 This PR adds unit to `euiTheme.font.scale.s` value, which fixes too small text. Before: ![image](https://github.com/user-attachments/assets/52a89b5f-a426-4934-b861-619e8d0bb483) After: <img width="525" alt="Screenshot 2025-07-02 at 18 09 31" src="https://github.com/user-attachments/assets/5f5e9e55-a86d-4d92-abf2-c500f5aeb2ce" />
1 parent d5f6e40 commit 5bd075c

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

  • src/platform/plugins/shared/unified_doc_viewer/public/components/doc_viewer_table

src/platform/plugins/shared/unified_doc_viewer/public/components/doc_viewer_table/table_cell_value.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
EuiTextColor,
1717
EuiToolTip,
1818
useResizeObserver,
19+
euiFontSize,
1920
type UseEuiTheme,
2021
} from '@elastic/eui';
2122
import React, { Fragment, useCallback, useState } from 'react';
@@ -200,18 +201,22 @@ export const TableFieldValue = ({
200201
};
201202

202203
const componentStyles = {
203-
docViewerValue: ({ euiTheme }: UseEuiTheme) =>
204-
css({
204+
docViewerValue: (themeContext: UseEuiTheme) => {
205+
const { euiTheme } = themeContext;
206+
const { fontSize } = euiFontSize(themeContext, 's');
207+
208+
return css({
205209
wordBreak: 'break-all',
206210
wordWrap: 'break-word',
207211
whiteSpace: 'pre-wrap',
208212
lineHeight: euiTheme.font.lineHeightMultiplier,
209213
verticalAlign: 'top',
210214

211215
'.euiDataGridRowCell__popover &': {
212-
fontSize: euiTheme.font.scale.s,
216+
fontSize,
213217
},
214-
}),
218+
});
219+
},
215220
docViewerValueHighlighted: ({ euiTheme }: UseEuiTheme) =>
216221
css({
217222
fontWeight: euiTheme.font.weight.bold,

0 commit comments

Comments
 (0)