Skip to content

Commit dec31c5

Browse files
[ObsUX] Use eui font size hook (elastic#204903)
## Summary Some font-size were not using the correct hook `useEuiFontSize`
1 parent 90277c3 commit dec31c5

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/cause_stacktrace.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* 2.0.
66
*/
77

8-
import { EuiAccordion, EuiTitle } from '@elastic/eui';
8+
import { EuiAccordion, EuiTitle, useEuiFontSize } from '@elastic/eui';
99
import { i18n } from '@kbn/i18n';
1010
import React from 'react';
1111
import styled from '@emotion/styled';
@@ -24,7 +24,7 @@ const CausedByContainer = styled('h5')`
2424
const CausedByHeading = styled('span')`
2525
color: ${({ theme }) => theme.euiTheme.colors.textSubdued};
2626
display: block;
27-
font-size: ${({ theme }) => theme.euiTheme.size.xs};
27+
font-size: ${() => useEuiFontSize('xs').fontSize};
2828
font-weight: ${({ theme }) => theme.euiTheme.font.weight.bold};
2929
text-transform: uppercase;
3030
`;

x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/stackframe.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* 2.0.
66
*/
77

8-
import { EuiAccordion } from '@elastic/eui';
8+
import { EuiAccordion, useEuiFontSize } from '@elastic/eui';
99
import React from 'react';
1010
import styled from '@emotion/styled';
1111
import {
@@ -19,8 +19,8 @@ import { Variables } from './variables';
1919
const ContextContainer = styled.div<{ isLibraryFrame: boolean }>`
2020
position: relative;
2121
font-family: ${({ theme }) => theme.euiTheme.font.familyCode};
22-
font-size: ${({ theme }) => theme.euiTheme.size.s};
23-
border: 1px solid ${({ theme }) => theme.euiTheme.colors.lightShade};
22+
font-size: ${() => useEuiFontSize('s').fontSize};
23+
border: ${({ theme }) => theme.euiTheme.border.thin};
2424
border-radius: ${({ theme }) => theme.euiTheme.border.radius.small};
2525
background: ${({ isLibraryFrame, theme }) =>
2626
isLibraryFrame ? theme.euiTheme.colors.emptyShade : theme.euiTheme.colors.lightestShade};

x-pack/plugins/observability_solution/infra/public/components/logging/log_minimap/time_ruler.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const TimeRuler: React.FC<TimeRulerProps> = ({ end, height, start, tickCo
6060
TimeRuler.displayName = 'TimeRuler';
6161

6262
const TimeRulerTickLabel = styled.text`
63-
font-size: 9px;
63+
font-size: ${() => useEuiFontSize('xxxs').fontSize};
6464
line-height: ${() => useEuiFontSize('s').lineHeight};
6565
fill: ${(props) => props.theme.euiTheme.colors.textSubdued};
6666
user-select: none;

x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/components/waffle/gradient_legend.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import React from 'react';
99
import styled from '@emotion/styled';
10+
import { useEuiFontSize } from '@elastic/eui';
1011
import {
1112
InfraFormatter,
1213
InfraWaffleMapBounds,
@@ -68,7 +69,7 @@ const GradientLegendTick = styled.div`
6869

6970
const GradientLegendTickLine = styled.div`
7071
position: absolute;
71-
background-color: ${(props) => props.theme.euiTheme.border.color};
72+
background-color: ${(props) => props.theme.euiTheme.colors.backgroundBaseSubdued};
7273
width: 1px;
7374
left: 0;
7475
top: 15px;
@@ -83,7 +84,7 @@ const GradientLegendTickLine = styled.div`
8384

8485
const GradientLegendTickLabel = styled.div`
8586
position: absolute;
86-
font-size: 11px;
87+
font-size: ${() => useEuiFontSize('xxs').fontSize};
8788
text-align: center;
8889
top: 0;
8990
left: 0;

x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/components/waffle/group_name.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* 2.0.
66
*/
77

8-
import { EuiLink, EuiToolTip } from '@elastic/eui';
8+
import { EuiLink, EuiToolTip, useEuiFontSize } from '@elastic/eui';
99
import React from 'react';
1010
import styled from '@emotion/styled';
1111
import { InfraWaffleMapGroup, InfraWaffleMapOptions } from '../../../../../common/inventory/types';
@@ -58,7 +58,7 @@ export class GroupName extends React.PureComponent<Props, {}> {
5858
const GroupNameContainer = styled.div`
5959
position: relative;
6060
text-align: center;
61-
font-size: 16px;
61+
font-size: ${(props) => useEuiFontSize('m').fontSize};
6262
margin-bottom: 5px;
6363
top: 20px;
6464
display: flex;
@@ -96,6 +96,6 @@ const Count = styled.div`
9696
flex: 0 0 auto;
9797
border-left: ${(props) => props.theme.euiTheme.border.thin};
9898
padding: 6px 10px;
99-
font-size: 0.85em;
99+
font-size: ${() => useEuiFontSize('xs').fontSize};
100100
font-weight: normal;
101101
`;

x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/components/waffle/steps_legend.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import { darken } from 'polished';
99
import React from 'react';
1010
import styled from '@emotion/styled';
11+
import { useEuiFontSize } from '@elastic/eui';
1112
import {
1213
InfraFormatter,
1314
InfraWaffleMapRuleOperator,
@@ -78,5 +79,5 @@ const StepSquareInner = styled.div`
7879
`;
7980

8081
const StepLabel = styled.div`
81-
font-size: 12px;
82+
font-size: ${() => useEuiFontSize('xs').fontSize};
8283
`;

0 commit comments

Comments
 (0)