fix: theme

This commit is contained in:
Barrett Ruth 2025-11-09 16:30:35 -05:00
parent 69c49b72b8
commit f63e429169
7 changed files with 29 additions and 23 deletions

View file

@ -52,7 +52,9 @@ const {
case "git":
return "#cc5500";
default:
return "#000000";
return getComputedStyle(document.documentElement)
.getPropertyValue("--text")
.trim();
}
};
</script>

View file

@ -53,7 +53,10 @@ const topicColor = getTopicColor(post?.collection);
<slot name="head" />
</Fragment>
<div class="post-container" style={`--topic-color: ${topicColor};`}>
<div
class="post-container"
style={topicColor ? `--topic-color: ${topicColor};` : ""}
>
<header class="post-header">
<h1 class="post-title">{title}</h1>
{frontmatter.date && <p class="post-meta">{frontmatter.date}</p>}

View file

@ -11,6 +11,6 @@ export function getTopicColor(topicName) {
case "git":
return "#cc5500";
default:
return "#000000";
return null;
}
}