Skip to content

Commit

Permalink
Ship a fixed font (Inter)
Browse files Browse the repository at this point in the history
The playwright pixel test fails otherwise rendering a different font in
CI. It's good for UI consistency anyways.
  • Loading branch information
subhoghoshX committed Jul 26, 2024
1 parent 298583b commit 089765f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const context = await esbuild.context({
],
outdir: "dist",
target: ["es2020"],
loader: { ".js": "jsx" },
loader: { ".js": "jsx", ".ttf": "file" },
plugins: [
{
name: "clean-dist",
Expand Down
Binary file added src/css/Inter.ttf
Binary file not shown.
4 changes: 4 additions & 0 deletions src/css/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,8 @@
@apply bg-background text-foreground;
font-feature-settings: "rlig" 1, "calt" 1;
}
@font-face {
font-family: "Inter";
src: url("./Inter.ttf") format("truetype");
}
}
2 changes: 1 addition & 1 deletion src/newtab/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function App() {
}, [todayUsage]);

return (
<main className="flex justify-center lg:items-center h-screen overflow-auto py-10 dark:bg-zinc-950">
<main className="flex justify-center lg:items-center h-screen overflow-auto py-10 dark:bg-zinc-950 font-sans">
<section className="flex gap-5 flex-col lg:flex-row h-fit">
<Card>
<CardHeader>
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = {
sm: "calc(var(--radius) - 4px)",
},
fontFamily: {
sans: ["var(--font-sans)", ...fontFamily.sans],
sans: ["Inter", ...fontFamily.sans],
},
keyframes: {
"accordion-down": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 089765f

Please sign in to comment.