Skip to content

Commit a751f12

Browse files
committed
♻️(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.
1 parent 8ee5063 commit a751f12

File tree

6 files changed

+31
-36
lines changed

6 files changed

+31
-36
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ and this project adheres to
1010

1111
### Changed
1212

13+
- ♻️(frontend) replace Arial font-family with token font #1411
1314
- ♿(frontend) improve accessibility:
1415
- #1354
16+
- #1349
1517
- ♿ improve accessibility by adding landmark roles to layout #1394
1618
- ♿ add document visible in list and openable via enter key #1365
1719
- ♿ add pdf outline property to enable bookmarks display #1368
@@ -29,8 +31,6 @@ and this project adheres to
2931
### Added
3032

3133
- ✨(api) add API route to fetch document content #1206
32-
- ♿(frontend) improve accessibility:
33-
- #1349
3434

3535
### Changed
3636

src/frontend/apps/impress/src/components/Text.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface TextProps extends BoxProps {
1313
$ellipsis?: boolean;
1414
$weight?: CSSProperties['fontWeight'];
1515
$textAlign?: CSSProperties['textAlign'];
16+
$textTransform?: CSSProperties['textTransform'];
1617
$size?: TextSizes | (string & {});
1718
$theme?:
1819
| 'primary'
@@ -43,6 +44,8 @@ export type TextType = ComponentPropsWithRef<typeof Text>;
4344

4445
export const TextStyled = styled(Box)<TextProps>`
4546
${({ $textAlign }) => $textAlign && `text-align: ${$textAlign};`}
47+
${({ $textTransform }) =>
48+
$textTransform && `text-transform: ${$textTransform};`}
4649
${({ $weight }) => $weight && `font-weight: ${$weight};`}
4750
${({ $size }) =>
4851
$size &&

src/frontend/apps/impress/src/cunningham/cunningham-style.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@
3838
);
3939
}
4040

41+
/**
42+
* Button
43+
*/
44+
.c__button {
45+
contain: content;
46+
}
47+
4148
/**
4249
* Modal
4350
*/

src/frontend/apps/impress/src/features/docs/doc-share/components/DocRoleDropdown.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,7 @@ export const DocRoleDropdown = ({
125125
},
126126
]}
127127
>
128-
<Text
129-
$theme="primary"
130-
$variation="800"
131-
$css={css`
132-
font-family: Arial, Helvetica, sans-serif;
133-
`}
134-
>
128+
<Text $theme="primary" $variation="800">
135129
{transRole(currentRole)}
136130
</Text>
137131
</DropdownMenu>

src/frontend/apps/impress/src/features/docs/doc-share/components/DocShareInvitation.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ export const DocShareModalInviteUserRow = ({
151151
$direction="row"
152152
$align="center"
153153
$css={css`
154-
font-family: Arial, Helvetica, sans-serif;
155-
font-size: var(--c--theme--font--sizes--sm);
156-
color: var(--c--theme--colors--greyscale-400);
154+
contain: content;
157155
`}
156+
$color="var(--c--theme--colors--greyscale-400)"
157+
$cursor="pointer"
158158
>
159-
<Text $theme="primary" $variation="800">
159+
<Text $theme="primary" $variation="800" $size="sm">
160160
{t('Add')}
161161
</Text>
162162
<Icon

src/frontend/apps/impress/src/features/docs/doc-share/components/UserAvatar.tsx

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { css } from 'styled-components';
22

3-
import { Box } from '@/components';
3+
import { Text } from '@/components';
44
import { tokens } from '@/cunningham';
55
import { User } from '@/features/auth';
66

@@ -37,35 +37,26 @@ export const UserAvatar = ({ user, background }: Props) => {
3737
const splitName = name?.split(' ');
3838

3939
return (
40-
<Box
40+
<Text
41+
className="--docs--user-avatar"
42+
$align="center"
43+
$color="rgba(255, 255, 255, 0.9)"
44+
$justify="center"
4145
$background={background || getColorFromName(name)}
4246
$width="24px"
4347
$height="24px"
44-
$direction="row"
45-
$align="center"
46-
$justify="center"
4748
$radius="50%"
49+
$size="10px"
50+
$textAlign="center"
51+
$textTransform="uppercase"
52+
$weight={600}
4853
$css={css`
49-
color: rgba(255, 255, 255, 0.9);
5054
border: 1px solid rgba(255, 255, 255, 0.5);
55+
contain: content;
5156
`}
52-
className="--docs--user-avatar"
5357
>
54-
<Box
55-
$direction="row"
56-
$css={css`
57-
text-align: center;
58-
font-style: normal;
59-
font-weight: 600;
60-
font-family:
61-
Arial, Helvetica, sans-serif; // Can't use marianne font because it's impossible to center with this font
62-
font-size: 10px;
63-
text-transform: uppercase;
64-
`}
65-
>
66-
{splitName[0]?.charAt(0)}
67-
{splitName?.[1]?.charAt(0)}
68-
</Box>
69-
</Box>
58+
{splitName[0]?.charAt(0)}
59+
{splitName?.[1]?.charAt(0)}
60+
</Text>
7061
);
7162
};

0 commit comments

Comments
 (0)