Skip to content
This repository has been archived by the owner on Mar 12, 2023. It is now read-only.

Reflect tag color #170

Merged
merged 2 commits into from
Feb 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/blog/tag/[tag]/before/[date]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const BlogTagBeforeDatePage = async ({ params: { tag: encodedTag, date: encodedD
<div className={styles.container}>
<div className={styles.mainContent}>
<header>
<h2><span className={`tag ${currentTag && colorClass(currentTag.color)}Background`}>{tag}</span> before {date.split('T')[0]}</h2>
<h2><span className={`tag ${currentTag && colorClass(currentTag.color)}`}>{tag}</span> before {date.split('T')[0]}</h2>
</header>

<NoContents contents={posts} />
Expand Down
2 changes: 1 addition & 1 deletion app/blog/tag/[tag]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const BlogTagPage = async ({ params: { tag: encodedTag } }) => {
<div className={styles.container}>
<div className={styles.mainContent}>
<header>
<h2><span className={`tag ${colorClass(currentTag.color)}Background`}>{tag}</span></h2>
<h2><span className={`tag ${colorClass(currentTag.color)}`}>{tag}</span></h2>
</header>

{posts.map(post => {
Expand Down
4 changes: 2 additions & 2 deletions components/blog-parts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const PostTags = ({ post }) => (
{post.Tags &&
post.Tags.length > 0 &&
post.Tags.map((tag: SelectProperty) => (
<Link href={getTagLink(tag.name)} className={`${colorClass(tag.color)}Background`} key={tag.name}>
<Link href={getTagLink(tag.name)} className={`tag ${colorClass(tag.color)}`} key={tag.name}>
{tag.name}
</Link>
))}
Expand Down Expand Up @@ -141,7 +141,7 @@ export const TagLinkList = ({ tags }) => {
{tags.map((tag: SelectProperty) => {
return (
<li key={tag.name}>
<Link href={getTagLink(tag.name)} className={`${colorClass(tag.color)}Background`}>
<Link href={getTagLink(tag.name)} className={`tag ${colorClass(tag.color)}`}>
{tag.name}
</Link>
</li>
Expand Down
41 changes: 41 additions & 0 deletions styles/notion-color.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,44 @@
.redBackground {
background: rgba(253, 235, 236, 1) !important;
}

.tag.light-gray {
color: rgb(28, 56, 41);
background: rgba(227, 226, 224, 0.5) !important;
}
.tag.gray {
color: rgb(28, 56, 41);
background: rgb(227, 226, 224) !important;
}
.tag.brown {
color: rgb(28, 56, 41);
background: rgb(238, 224, 218) !important;
}
.tag.orange {
color: rgb(28, 56, 41);
background: rgb(250, 222, 201) !important;
}
.tag.yellow {
color: rgb(28, 56, 41);
background: rgb(253, 236, 200) !important;
}
.tag.green {
color: rgb(28, 56, 41);
background: rgb(219, 237, 219) !important;
}
.tag.blue {
color: rgb(28, 56, 41);
background: rgb(211, 229, 239) !important;
}
.tag.purple {
color: rgb(28, 56, 41);
background: rgb(232, 222, 238) !important;
}
.tag.pink {
color: rgb(28, 56, 41);
background: rgb(245, 224, 233) !important;
}
.tag.red {
color: rgb(28, 56, 41);
background: rgb(255, 226, 221) !important;
}