File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ export function BlogCard({
23
23
className,
24
24
...rest
25
25
} : BlogCardProps ) {
26
-
27
26
return (
28
27
< NextLink
29
28
href = { route }
@@ -35,12 +34,8 @@ export function BlogCard({
35
34
) }
36
35
{ ...rest }
37
36
>
38
- < BlogCardPicture
39
- frontMatter = { frontMatter }
40
- // this weird selector sets background to tags so they look better on top of the picture
41
- className = "aspect-[2.23] [&>*>*>*]:bg-neu-0"
42
- >
43
- < BlogTags tags = { frontMatter . tags } />
37
+ < BlogCardPicture frontMatter = { frontMatter } className = "aspect-[4.75]" >
38
+ < BlogTags tags = { frontMatter . tags } opaque />
44
39
</ BlogCardPicture >
45
40
< div className = "flex grow flex-col border border-neu-200 dark:border-neu-50" >
46
41
< div className = "typography-body-lg grow text-pretty p-4" >
Original file line number Diff line number Diff line change @@ -2,16 +2,22 @@ import { Tag } from "@/app/conf/_design-system/tag"
2
2
3
3
import { blogTagColors } from "./blog-tag-colors"
4
4
5
- export function BlogTags ( { tags } : { tags : string [ ] } ) {
5
+ export function BlogTags ( {
6
+ tags,
7
+ opaque,
8
+ } : {
9
+ tags : string [ ]
10
+ opaque ?: boolean
11
+ } ) {
6
12
return (
7
13
< div className = "flex gap-2" >
8
14
{ tags . map ( tag => {
9
15
const color = blogTagColors [ tag ]
10
- if ( ! color ) {
16
+ if ( ! color && process . env . NODE_ENV !== "production" ) {
11
17
throw new Error ( `No color found for tag: ${ tag } ` )
12
18
}
13
19
return (
14
- < Tag color = { color } key = { tag } >
20
+ < Tag className = { opaque ? "bg-neu-0" : "" } color = { color } key = { tag } >
15
21
{ tag . replaceAll ( "-" , " " ) }
16
22
</ Tag >
17
23
)
You can’t perform that action at this time.
0 commit comments