From 61e808ca53dfc19bb3cc61c4666a2e7b92eded3c Mon Sep 17 00:00:00 2001 From: Tanner Linsley Date: Fri, 22 May 2026 15:53:10 -0600 Subject: [PATCH] feat(blog): theme cover-fallback gradients by library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Blog posts without a header image now generate a gradient palette around their library's primary hue (Virtual → purple, Query → red, etc.) instead of picking one of eight slug-hashed palettes. Posts without a `library` frontmatter keep the existing slug-hash behavior. Also reworked the blob generator so gradients read as soft watercolor washes: bigger radii with ry biased > rx to compensate for wide containers, anchors scattered across the canvas with per-slug jitter, and soft falloff stops so blobs blend into each other rather than rendering as discrete circles. A linear base tint sits underneath so edges never wash out to the wrapper background. --- src/components/BlogCard.tsx | 6 +- src/components/CoverFallback.tsx | 10 ++- src/routes/blog.$.tsx | 3 +- src/utils/blog.functions.ts | 1 + src/utils/ogGradient.ts | 143 ++++++++++++++++++++++++++----- 5 files changed, 137 insertions(+), 26 deletions(-) diff --git a/src/components/BlogCard.tsx b/src/components/BlogCard.tsx index f89777793..9f7811031 100644 --- a/src/components/BlogCard.tsx +++ b/src/components/BlogCard.tsx @@ -58,7 +58,11 @@ export function BlogCard({ post, showLibraryBadges = true }: BlogCardProps) { /> ) : ( - + )}
diff --git a/src/components/CoverFallback.tsx b/src/components/CoverFallback.tsx index caa289064..b1923e4d5 100644 --- a/src/components/CoverFallback.tsx +++ b/src/components/CoverFallback.tsx @@ -3,11 +3,17 @@ import { gradientBackgroundCss } from '~/utils/ogGradient' type CoverFallbackProps = { slug: string + library?: string className?: string style?: React.CSSProperties } -export function CoverFallback({ slug, className, style }: CoverFallbackProps) { +export function CoverFallback({ + slug, + library, + className, + style, +}: CoverFallbackProps) { return (