Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ObsUX] Use eui font size hook #204903

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { EuiAccordion, EuiTitle } from '@elastic/eui';
import { EuiAccordion, EuiTitle, useEuiFontSize } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React from 'react';
import styled from '@emotion/styled';
Expand All @@ -24,7 +24,7 @@ const CausedByContainer = styled('h5')`
const CausedByHeading = styled('span')`
color: ${({ theme }) => theme.euiTheme.colors.textSubdued};
display: block;
font-size: ${({ theme }) => theme.euiTheme.size.xs};
font-size: ${() => useEuiFontSize('xs').fontSize};
font-weight: ${({ theme }) => theme.euiTheme.font.weight.bold};
text-transform: uppercase;
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { EuiAccordion } from '@elastic/eui';
import { EuiAccordion, useEuiFontSize } from '@elastic/eui';
import React from 'react';
import styled from '@emotion/styled';
import {
Expand All @@ -19,8 +19,8 @@ import { Variables } from './variables';
const ContextContainer = styled.div<{ isLibraryFrame: boolean }>`
position: relative;
font-family: ${({ theme }) => theme.euiTheme.font.familyCode};
font-size: ${({ theme }) => theme.euiTheme.size.s};
border: 1px solid ${({ theme }) => theme.euiTheme.colors.lightShade};
font-size: ${() => useEuiFontSize('s').fontSize};
border: ${({ theme }) => theme.euiTheme.border.thin};
border-radius: ${({ theme }) => theme.euiTheme.border.radius.small};
background: ${({ isLibraryFrame, theme }) =>
isLibraryFrame ? theme.euiTheme.colors.emptyShade : theme.euiTheme.colors.lightestShade};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const TimeRuler: React.FC<TimeRulerProps> = ({ end, height, start, tickCo
TimeRuler.displayName = 'TimeRuler';

const TimeRulerTickLabel = styled.text`
font-size: 9px;
font-size: ${() => useEuiFontSize('xxxs').fontSize};
line-height: ${() => useEuiFontSize('s').lineHeight};
fill: ${(props) => props.theme.euiTheme.colors.textSubdued};
user-select: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import React from 'react';
import styled from '@emotion/styled';
import { useEuiFontSize } from '@elastic/eui';
import {
InfraFormatter,
InfraWaffleMapBounds,
Expand Down Expand Up @@ -68,7 +69,7 @@ const GradientLegendTick = styled.div`

const GradientLegendTickLine = styled.div`
position: absolute;
background-color: ${(props) => props.theme.euiTheme.border.color};
background-color: ${(props) => props.theme.euiTheme.colors.backgroundBaseSubdued};
width: 1px;
left: 0;
top: 15px;
Expand All @@ -83,7 +84,7 @@ const GradientLegendTickLine = styled.div`

const GradientLegendTickLabel = styled.div`
position: absolute;
font-size: 11px;
font-size: ${() => useEuiFontSize('xxs').fontSize};
text-align: center;
top: 0;
left: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { EuiLink, EuiToolTip } from '@elastic/eui';
import { EuiLink, EuiToolTip, useEuiFontSize } from '@elastic/eui';
import React from 'react';
import styled from '@emotion/styled';
import { InfraWaffleMapGroup, InfraWaffleMapOptions } from '../../../../../common/inventory/types';
Expand Down Expand Up @@ -58,7 +58,7 @@ export class GroupName extends React.PureComponent<Props, {}> {
const GroupNameContainer = styled.div`
position: relative;
text-align: center;
font-size: 16px;
font-size: ${(props) => useEuiFontSize('m').fontSize};
margin-bottom: 5px;
top: 20px;
display: flex;
Expand Down Expand Up @@ -96,6 +96,6 @@ const Count = styled.div`
flex: 0 0 auto;
border-left: ${(props) => props.theme.euiTheme.border.thin};
padding: 6px 10px;
font-size: 0.85em;
font-size: ${() => useEuiFontSize('xs').fontSize};
font-weight: normal;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import { darken } from 'polished';
import React from 'react';
import styled from '@emotion/styled';
import { useEuiFontSize } from '@elastic/eui';
import {
InfraFormatter,
InfraWaffleMapRuleOperator,
Expand Down Expand Up @@ -78,5 +79,5 @@ const StepSquareInner = styled.div`
`;

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