File tree Expand file tree Collapse file tree 2 files changed +38
-20
lines changed Expand file tree Collapse file tree 2 files changed +38
-20
lines changed Original file line number Diff line number Diff line change 8
8
display : flex;
9
9
align-items : center;
10
10
justify-content : space-between;
11
+ flex-wrap : wrap;
11
12
gap : 0.75rem ;
13
+
12
14
margin-bottom : 1rem ;
13
- flex-wrap : wrap;
14
15
}
15
16
16
- .category-tag {
17
+ .post-category {
18
+ display : flex;
19
+ align-items : center;
20
+ gap : 0.125rem ;
21
+ }
22
+
23
+ .post-category * {
24
+ display : block;
25
+ }
26
+
27
+ .post-category .category-tag {
17
28
display : inline-block;
18
- background-color : var (--vp-c-brand );
19
- color : var (--vp-c-white );
20
- font-size : 0.75rem ;
21
- font-weight : 600 ;
22
29
23
- border-radius : 1rem ;
24
- text-transform : uppercase;
30
+ font-size : 0.875rem ;
25
31
letter-spacing : 0.05em ;
32
+
33
+ color : var (--vp-c-text-2 );
34
+ background-color : var (--vp-c-brand );
35
+ }
36
+
37
+ .post-category .category-indicator {
38
+ display : inline-block;
39
+
40
+ width : 12px ;
41
+ height : 12px ;
42
+
43
+ margin-right : 0.5rem ;
44
+ border-radius : 50% ;
26
45
}
27
46
28
47
.created-date {
29
48
color : var (--vp-c-text-2 );
30
49
font-size : 0.875rem ;
31
- font-weight : 500 ;
32
50
}
33
51
34
52
.post-title {
53
+ margin : 0 0 1.5rem 0 ;
54
+
35
55
font-size : 2.25rem ;
36
56
font-weight : 700 ;
37
57
line-height : 1.2 ;
38
- margin : 0 0 1rem 0 ;
39
- color : var (--vp-c-text-1 );
40
- }
41
58
42
- .post-description {
43
- font-size : 1.125rem ;
44
- line-height : 1.6 ;
45
- color : var (--vp-c-text-2 );
46
- margin : 0 ;
47
- font-weight : 400 ;
59
+ color : var (--vp-c-text-1 );
48
60
}
49
61
50
62
/* 다크 테마 대응 */
Original file line number Diff line number Diff line change 2
2
import { useData } from " vitepress" ;
3
3
import { computed } from " vue" ;
4
4
import { formatDate } from " @/utils/date" ;
5
+ import { getCategoryColor } from " @/constants/colors" ;
5
6
6
7
const { frontmatter } = useData ();
7
8
8
9
const title = computed (() => frontmatter .value .title || " " );
9
10
const createdAt = computed (() => frontmatter .value .createdAt || " " );
10
11
const category = computed (() => frontmatter .value .category || " " );
11
- const description = computed (() => frontmatter .value .description || " " );
12
12
</script >
13
13
14
14
<template >
15
15
<header class =" post-header" >
16
16
<h1 class =" post-title" >{{ title }}</h1 >
17
17
18
18
<div class =" post-meta" >
19
- <span v-if =" category" class =" category-tag" >{{ category }}</span >
19
+ <div class =" post-category" v-if =" category" >
20
+ <span
21
+ class =" category-indicator"
22
+ :style =" { backgroundColor: getCategoryColor(category) }"
23
+ />
24
+ <span class =" category-tag" >{{ category }}</span >
25
+ </div >
20
26
<time v-if =" createdAt" class =" created-date" >{{ formatDate(createdAt) }}</time >
21
27
</div >
22
28
</header >
You can’t perform that action at this time.
0 commit comments