♻️(frontend) replace Arial font-family with token font

In some components, the Arial font was still used
because of a centering problem.
We removed all instances of Arial and replaced them
with the current font token, the centering problems
were fixed by adding "contain: content;" to the css.
This commit is contained in:
Anthony LC
2025-09-19 14:58:06 +02:00
parent 8ee50631f3
commit a751f1255a
6 changed files with 31 additions and 36 deletions

View File

@@ -13,6 +13,7 @@ export interface TextProps extends BoxProps {
$ellipsis?: boolean;
$weight?: CSSProperties['fontWeight'];
$textAlign?: CSSProperties['textAlign'];
$textTransform?: CSSProperties['textTransform'];
$size?: TextSizes | (string & {});
$theme?:
| 'primary'
@@ -43,6 +44,8 @@ export type TextType = ComponentPropsWithRef<typeof Text>;
export const TextStyled = styled(Box)<TextProps>`
${({ $textAlign }) => $textAlign && `text-align: ${$textAlign};`}
${({ $textTransform }) =>
$textTransform && `text-transform: ${$textTransform};`}
${({ $weight }) => $weight && `font-weight: ${$weight};`}
${({ $size }) =>
$size &&

View File

@@ -38,6 +38,13 @@
);
}
/**
* Button
*/
.c__button {
contain: content;
}
/**
* Modal
*/

View File

@@ -125,13 +125,7 @@ export const DocRoleDropdown = ({
},
]}
>
<Text
$theme="primary"
$variation="800"
$css={css`
font-family: Arial, Helvetica, sans-serif;
`}
>
<Text $theme="primary" $variation="800">
{transRole(currentRole)}
</Text>
</DropdownMenu>

View File

@@ -151,12 +151,12 @@ export const DocShareModalInviteUserRow = ({
$direction="row"
$align="center"
$css={css`
font-family: Arial, Helvetica, sans-serif;
font-size: var(--c--theme--font--sizes--sm);
color: var(--c--theme--colors--greyscale-400);
contain: content;
`}
$color="var(--c--theme--colors--greyscale-400)"
$cursor="pointer"
>
<Text $theme="primary" $variation="800">
<Text $theme="primary" $variation="800" $size="sm">
{t('Add')}
</Text>
<Icon

View File

@@ -1,6 +1,6 @@
import { css } from 'styled-components';
import { Box } from '@/components';
import { Text } from '@/components';
import { tokens } from '@/cunningham';
import { User } from '@/features/auth';
@@ -37,35 +37,26 @@ export const UserAvatar = ({ user, background }: Props) => {
const splitName = name?.split(' ');
return (
<Box
<Text
className="--docs--user-avatar"
$align="center"
$color="rgba(255, 255, 255, 0.9)"
$justify="center"
$background={background || getColorFromName(name)}
$width="24px"
$height="24px"
$direction="row"
$align="center"
$justify="center"
$radius="50%"
$size="10px"
$textAlign="center"
$textTransform="uppercase"
$weight={600}
$css={css`
color: rgba(255, 255, 255, 0.9);
border: 1px solid rgba(255, 255, 255, 0.5);
contain: content;
`}
className="--docs--user-avatar"
>
<Box
$direction="row"
$css={css`
text-align: center;
font-style: normal;
font-weight: 600;
font-family:
Arial, Helvetica, sans-serif; // Can't use marianne font because it's impossible to center with this font
font-size: 10px;
text-transform: uppercase;
`}
>
{splitName[0]?.charAt(0)}
{splitName?.[1]?.charAt(0)}
</Box>
</Box>
{splitName[0]?.charAt(0)}
{splitName?.[1]?.charAt(0)}
</Text>
);
};