fix: theme
This commit is contained in:
parent
69c49b72b8
commit
f63e429169
7 changed files with 29 additions and 23 deletions
|
|
@ -52,7 +52,9 @@ const {
|
|||
case "git":
|
||||
return "#cc5500";
|
||||
default:
|
||||
return "#000000";
|
||||
return getComputedStyle(document.documentElement)
|
||||
.getPropertyValue("--text")
|
||||
.trim();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -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>}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@ export function getTopicColor(topicName) {
|
|||
case "git":
|
||||
return "#cc5500";
|
||||
default:
|
||||
return "#000000";
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue