mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 07:33:07 +08:00
feat: integrate Astro fonts API with Google Sans Code font (#602)
- Add Google Sans Code font and make it the default font - Font is preloaded with latin subset and weight 400 and style normal for optimal performance - Add font configuration section in how to config docs
This commit is contained in:
+11
-1
@@ -1,4 +1,4 @@
|
||||
import { defineConfig, envField } from "astro/config";
|
||||
import { defineConfig, envField, fontProviders } from "astro/config";
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import sitemap from "@astrojs/sitemap";
|
||||
import remarkToc from "remark-toc";
|
||||
@@ -59,5 +59,15 @@ export default defineConfig({
|
||||
},
|
||||
experimental: {
|
||||
preserveScriptOrder: true,
|
||||
fonts: [
|
||||
{
|
||||
name: "Google Sans Code",
|
||||
cssVariable: "--font-google-sans-code",
|
||||
provider: fontProviders.google(),
|
||||
fallbacks: ["monospace"],
|
||||
weights: [300, 400, 500, 600, 700],
|
||||
styles: ["normal", "italic"],
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user