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

Fix: Intelligently size fallback fonts #137

Merged
merged 3 commits into from
Nov 23, 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
26 changes: 24 additions & 2 deletions src/lib/styles/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,32 @@
url('/fonts/LabilGrotesk-Bold.woff') format('woff');
}

/* Font fallbacks */
/* Manually sized via https://screenspan.net/fallback */
@font-face {
font-family: 'Labil Grotesk fallback';
font-style: normal;
font-weight: 400;
src: local('Arial');
size-adjust: 101%;
ascent-override: 102%;
descent-override: 23%;
line-gap-override: normal;
}

@font-face {
font-family: 'Labil Grotesk fallback';
font-style: normal;
font-weight: bold;
src: local('Arial Bold');
ascent-override: 102%;
descent-override: 23%;
line-gap-override: normal;
}

:root {
/* Font families */
--font-sans: 'Labil Grotesk', system-ui, -apple-system, 'Segoe UI', roboto, 'Helvetica Neue',
sans-serif, serif;
--font-sans: 'Labil Grotesk', 'Labil Grotesk fallback', system-ui, sans-serif;

--font-stable: 'salt' off;
--font-unstable: 'salt' 1, 'ss01' 1, 'ss02' 1, 'ss03' 1, 'ss04' 1;
Expand Down
1 change: 1 addition & 0 deletions svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ const config = {
})
}
};

export default config;