From b679d0afe1d229dcf9526a905c58e928d4988e19 Mon Sep 17 00:00:00 2001 From: the3ash <24548223+the3ash@users.noreply.github.com> Date: Wed, 16 Jul 2025 00:13:55 +0800 Subject: [PATCH] perf: tweak css performance --- astro.config.ts | 8 ++--- src/components/layout/TransitionWrapper.astro | 2 +- src/components/ui/CopyCode.astro | 2 +- src/components/ui/GitHubCard.astro | 34 +++++++++---------- src/components/ui/TableOfContents.astro | 2 +- src/components/ui/XPOST.astro | 8 ++--- src/components/widgets/FormattedDate.astro | 6 +++- 7 files changed, 32 insertions(+), 30 deletions(-) diff --git a/astro.config.ts b/astro.config.ts index 1cf6020..3409ce7 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -32,11 +32,11 @@ export default defineConfig({ rehypePlugins: [rehypeKatex, rehypeCleanup, rehypeImageProcessor, rehypeCopyCode] }, integrations: [ - mdx(), - sitemap(), playformInline({ - Path: ['./src/styles'] - }) + Exclude: [(file) => file.toLowerCase().includes('katex')] + }), + mdx(), + sitemap() ], vite: { resolve: { diff --git a/src/components/layout/TransitionWrapper.astro b/src/components/layout/TransitionWrapper.astro index 2360d63..be02c6f 100644 --- a/src/components/layout/TransitionWrapper.astro +++ b/src/components/layout/TransitionWrapper.astro @@ -52,7 +52,7 @@ const transitionName = type === 'post' ? 'post-content' : 'page-content' document.addEventListener('touchstart', cleanupHover, { passive: true }) -