Skip to content

chore(site): use variable font for inter #10903

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

Merged
merged 2 commits into from
Nov 27, 2023
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
1 change: 1 addition & 0 deletions site/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = {
moduleDirectories: ["node_modules", "<rootDir>/src"],
moduleNameMapper: {
"\\.css$": "<rootDir>/src/testHelpers/styleMock.ts",
"^@fontsource": "<rootDir>/src/testHelpers/styleMock.ts",
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"@emotion/react": "11.11.1",
"@emotion/styled": "11.11.0",
"@fastly/performance-observer-polyfill": "2.0.0",
"@fontsource-variable/inter": "5.0.15",
"@fontsource/ibm-plex-mono": "5.0.5",
"@fontsource/inter": "5.0.2",
"@monaco-editor/react": "4.6.0",
"@mui/icons-material": "5.14.0",
"@mui/lab": "5.0.0-alpha.129",
Expand Down
16 changes: 8 additions & 8 deletions site/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions site/src/components/WorkspaceBuildLogs/WorkspaceBuildLogs.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dayjs from "dayjs";
import { type ComponentProps, type FC, Fragment } from "react";
import type { ProvisionerJobLog } from "api/typesGenerated";
import { MONOSPACE_FONT_FAMILY } from "theme/constants";
import { BODY_FONT_FAMILY, MONOSPACE_FONT_FAMILY } from "theme/constants";
import { Logs } from "./Logs";
import Box from "@mui/material/Box";
import { type Interpolation, type Theme } from "@emotion/react";
Expand Down Expand Up @@ -100,7 +100,7 @@ const styles = {
padding: "4px 24px",
display: "flex",
alignItems: "center",
fontFamily: "Inter",
fontFamily: BODY_FONT_FAMILY,
borderBottom: `1px solid ${theme.palette.divider}`,
background: theme.palette.background.default,

Expand Down
2 changes: 1 addition & 1 deletion site/src/theme/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const borderRadius = 8;
export const MONOSPACE_FONT_FAMILY =
"'IBM Plex Mono', 'Lucida Console', 'Lucida Sans Typewriter', 'Liberation Mono', 'Monaco', 'Courier New', Courier, monospace";
export const BODY_FONT_FAMILY = `"Inter", system-ui, sans-serif`;
export const BODY_FONT_FAMILY = `"Inter Variable", system-ui, sans-serif`;
Copy link
Member

@Parkreiner Parkreiner Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be on the safe side, I feel like it'd be good to include Inter as the second variable in the stack

We won't be serving it up, but if the user just happens to have it downloaded, they'll still get a pretty equivalent UI

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is too much to be honest since this font will be cached on the first load.

export const navHeight = 62;
export const containerWidth = 1380;
export const containerWidthMedium = 1080;
Expand Down
5 changes: 1 addition & 4 deletions site/src/theme/globalFonts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@
import "@fontsource/ibm-plex-mono/400.css";
import "@fontsource/ibm-plex-mono/600.css";
// Main body copy font
import "@fontsource/inter/300.css";
import "@fontsource/inter/400.css";
import "@fontsource/inter/500.css";
import "@fontsource/inter/600.css";
import "@fontsource-variable/inter";