Skip to content

Commit f1850df

Browse files
committed
feature: add styles for social icons
1 parent d0b1702 commit f1850df

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

src/.vitepress/components/TeamCard.vue

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup>
22
import { computed, defineProps } from 'vue'
3+
import { VTIconGitHub, VTIconTwitter } from '@vue/theme'
34
45
const props = defineProps({
56
profile: {
@@ -37,13 +38,22 @@ const imageAlt = computed(() => {
3738
</li>
3839
</ul>
3940
<a :href="profile.website.url">{{ profile.website.label }}</a>
40-
<ul>
41+
<ul class="member-social-list">
4142
<li
4243
v-for="(handle, platform) in profile.social"
4344
:key="`${platform}-${handle}`"
45+
class="member-social-item"
4446
>
4547
<a :href="`https://www.${platform}.com/${handle}`">
46-
{{ platform }}: {{ handle }}
48+
<VTIconGitHub
49+
v-if="platform === 'github'"
50+
class="member-social-icon"
51+
/>
52+
<VTIconTwitter
53+
v-else-if="platform === 'twitter'"
54+
class="member-social-icon"
55+
/>
56+
<span v-else> {{ platform }}: {{ handle }} </span>
4757
</a>
4858
</li>
4959
</ul>
@@ -72,4 +82,22 @@ const imageAlt = computed(() => {
7282
height: 80px;
7383
border-radius: 50%;
7484
}
85+
86+
.member-social-icon {
87+
width: 24px;
88+
height: 24px;
89+
fill: rgba(60, 60, 60, 0.6);
90+
margin-right: 14px;
91+
}
92+
93+
.member-social-item:before {
94+
/* Override list bullet which exists in
95+
.vt-doc ul > li:before */
96+
display: none;
97+
}
98+
99+
.member-social-list {
100+
padding: 0;
101+
display: flex;
102+
}
75103
</style>

src/about/team.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"url": "https://www.patreon.com/evanyou"
1414
},
1515
"social": {
16-
"twitter": "youyuxi",
17-
"github": "yyx990803"
16+
"github": "yyx990803",
17+
"twitter": "youyuxi"
1818
}
1919
},
2020
{
@@ -31,8 +31,8 @@
3131
"url": "https://www.bencodezen.io"
3232
},
3333
"social": {
34-
"twitter": "bencodezen",
35-
"github": "bencodezen"
34+
"github": "bencodezen",
35+
"twitter": "bencodezen"
3636
}
3737
}
3838
]

0 commit comments

Comments
 (0)