refactor(font): use local woff2

This commit is contained in:
enscribe 2024-09-18 17:52:04 -07:00
parent 42951e4d01
commit 3b1fcf5663
No known key found for this signature in database
GPG key ID: 9BBD5C4114E25322
9 changed files with 21 additions and 24 deletions

14
package-lock.json generated
View file

@ -15,8 +15,6 @@
"@astrojs/rss": "^4.0.7", "@astrojs/rss": "^4.0.7",
"@astrojs/sitemap": "^3.1.6", "@astrojs/sitemap": "^3.1.6",
"@astrojs/tailwind": "^5.1.0", "@astrojs/tailwind": "^5.1.0",
"@fontsource/geist-mono": "^5.0.3",
"@fontsource/geist-sans": "^5.0.3",
"@hbsnow/rehype-sectionize": "^1.0.7", "@hbsnow/rehype-sectionize": "^1.0.7",
"@radix-ui/react-avatar": "^1.1.0", "@radix-ui/react-avatar": "^1.1.0",
"@radix-ui/react-dropdown-menu": "^2.1.1", "@radix-ui/react-dropdown-menu": "^2.1.1",
@ -1171,18 +1169,6 @@
"resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.7.tgz", "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.7.tgz",
"integrity": "sha512-X8R8Oj771YRl/w+c1HqAC1szL8zWQRwFvgDwT129k9ACdBoud/+/rX9V0qiMl6LWUdP9voC2nDVZYPMQQsb6eA==" "integrity": "sha512-X8R8Oj771YRl/w+c1HqAC1szL8zWQRwFvgDwT129k9ACdBoud/+/rX9V0qiMl6LWUdP9voC2nDVZYPMQQsb6eA=="
}, },
"node_modules/@fontsource/geist-mono": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/@fontsource/geist-mono/-/geist-mono-5.0.3.tgz",
"integrity": "sha512-ekY5FNiK7aMxan/c6lgVQa/rIwQ/AMEJZJWY7768jBrLVdkrCxfEfCe1ePpe7C3JnySy7c9R6HC4Xh4ksfjTaw==",
"license": "OFL-1.1"
},
"node_modules/@fontsource/geist-sans": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/@fontsource/geist-sans/-/geist-sans-5.0.3.tgz",
"integrity": "sha512-oGwoSIqNPMvjtCwj1lZaEr47MeiG27XPhypwkF643u1TQduvwbm3V3hYB01JekeaT34SAGP4I1h+WCdRpJkcwA==",
"license": "OFL-1.1"
},
"node_modules/@hbsnow/rehype-sectionize": { "node_modules/@hbsnow/rehype-sectionize": {
"version": "1.0.7", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/@hbsnow/rehype-sectionize/-/rehype-sectionize-1.0.7.tgz", "resolved": "https://registry.npmjs.org/@hbsnow/rehype-sectionize/-/rehype-sectionize-1.0.7.tgz",

View file

@ -19,8 +19,6 @@
"@astrojs/rss": "^4.0.7", "@astrojs/rss": "^4.0.7",
"@astrojs/sitemap": "^3.1.6", "@astrojs/sitemap": "^3.1.6",
"@astrojs/tailwind": "^5.1.0", "@astrojs/tailwind": "^5.1.0",
"@fontsource/geist-mono": "^5.0.3",
"@fontsource/geist-sans": "^5.0.3",
"@hbsnow/rehype-sectionize": "^1.0.7", "@hbsnow/rehype-sectionize": "^1.0.7",
"@radix-ui/react-avatar": "^1.1.0", "@radix-ui/react-avatar": "^1.1.0",
"@radix-ui/react-dropdown-menu": "^2.1.1", "@radix-ui/react-dropdown-menu": "^2.1.1",

Binary file not shown.

BIN
public/fonts/GeistVF.woff2 Normal file

Binary file not shown.

View file

@ -2,9 +2,6 @@
import '../styles/global.css' import '../styles/global.css'
import '../styles/katex.css' import '../styles/katex.css'
import '@fontsource/geist-mono'
import '@fontsource/geist-sans'
import { ViewTransitions } from 'astro:transitions' import { ViewTransitions } from 'astro:transitions'
interface Props { interface Props {

View file

@ -57,7 +57,7 @@ function buildToc(headings: Heading[]): Heading[] {
> >
<div class="mr-6 flex justify-end"> <div class="mr-6 flex justify-end">
<ul <ul
class="max-h-[calc(100vh-8rem)] space-y-2 overflow-y-auto" class="max-h-[calc(100vh-8rem)] flex flex-col gap-y-2 overflow-y-auto mr-6 justify-end"
id="toc-container" id="toc-container"
> >
<li> <li>

View file

@ -8,11 +8,11 @@ const buttonVariants = cva(
{ {
variants: { variants: {
variant: { variant: {
default: 'bg-primary text-primary-foreground hover:bg-primary/90', default: 'bg-primary text-primary-foreground hover:bg-secondary/50',
destructive: destructive:
'bg-destructive text-destructive-foreground over:bg-destructive/90', 'bg-destructive text-destructive-foreground over:bg-destructive/50',
outline: outline:
'border border-input bg-background hover:bg-accent hover:text-accent-foreground', 'border border-input bg-background hover:bg-secondary/50',
secondary: secondary:
'bg-secondary text-secondary-foreground hover:bg-secondary/80', 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
ghost: 'hover:bg-accent hover:text-accent-foreground', ghost: 'hover:bg-accent hover:text-accent-foreground',

View file

@ -2,6 +2,22 @@
@tailwind components; @tailwind components;
@tailwind utilities; @tailwind utilities;
@font-face {
font-family: 'Geist';
src: url('/fonts/GeistVF.woff2') format('woff2');
font-weight: 100 900;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Geist Mono';
src: url('/fonts/GeistMonoVF.woff2') format('woff2');
font-weight: 100 900;
font-style: normal;
font-display: swap;
}
@layer base { @layer base {
:root { :root {
--background: 0 0% 100%; --background: 0 0% 100%;

View file

@ -7,7 +7,7 @@ const config: Config = {
theme: { theme: {
extend: { extend: {
fontFamily: { fontFamily: {
sans: ['Geist Sans', ...defaultTheme.fontFamily.sans], sans: ['Geist', ...defaultTheme.fontFamily.sans],
mono: ['Geist Mono', ...defaultTheme.fontFamily.mono], mono: ['Geist Mono', ...defaultTheme.fontFamily.mono],
}, },
colors: { colors: {