Skip to content

Commit ddfe0c8

Browse files
committed
style(ui): update homepage styling and improve navigation cards
1 parent 9dab339 commit ddfe0c8

4 files changed

Lines changed: 90 additions & 30 deletions

File tree

docs/.vitepress/theme/components/NavCard.vue

Lines changed: 68 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,29 +50,60 @@ defineProps({
5050
text-decoration: none !important;
5151
color: inherit !important;
5252
display: block;
53+
outline: none;
54+
border-bottom: 0 !important;
55+
}
56+
57+
.nav-card-link:focus,
58+
.nav-card-link:focus-visible,
59+
.nav-card-link:active {
60+
outline: none !important;
61+
box-shadow: none !important;
62+
text-decoration: none !important;
63+
border-bottom: 0 !important;
64+
border-bottom-color: transparent !important;
65+
}
66+
67+
.nav-card-link:hover,
68+
.nav-card-link:visited {
69+
text-decoration: none !important;
70+
border-bottom: 0 !important;
71+
border-bottom-color: transparent !important;
72+
}
73+
74+
.nav-card-link:focus-visible .nav-card {
75+
border-color: #0066cc;
76+
box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.18);
5377
}
5478
5579
.nav-card {
56-
border: 1px solid color-mix(in srgb, var(--vp-c-brand-1) 12%, var(--vp-c-divider));
57-
border-radius: 22px;
80+
border: 1px solid rgba(0, 0, 0, 0.04);
81+
border-radius: 24px;
5882
padding: 20px 22px;
59-
transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
60-
background:
61-
radial-gradient(circle at 100% -10%, color-mix(in srgb, var(--vp-c-brand-1) 12%, transparent), transparent 45%),
62-
linear-gradient(165deg, color-mix(in srgb, var(--vp-c-brand-1) 6%, var(--vp-c-bg-soft)) 0%, var(--vp-c-bg-soft) 100%);
83+
transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
84+
background: #fff;
6385
height: 100%;
64-
min-height: 132px;
65-
backdrop-filter: blur(10px);
86+
min-height: 124px;
87+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
88+
position: relative;
89+
overflow: hidden;
6690
}
6791
6892
.nav-card:hover {
69-
border-color: var(--vp-c-brand);
70-
transform: translateY(-4px) scale(1.01);
71-
box-shadow: 0 18px 40px rgba(0, 113, 227, 0.14);
93+
transform: translateY(-4px);
94+
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
95+
border-color: rgba(0, 0, 0, 0.08);
96+
}
97+
98+
.dark .nav-card {
99+
border-color: rgba(255, 255, 255, 0.08);
100+
background: var(--vp-c-bg-mute);
101+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
72102
}
73103
74104
.dark .nav-card:hover {
75-
box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
105+
border-color: rgba(255, 255, 255, 0.14);
106+
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
76107
}
77108
78109
.card-top {
@@ -84,29 +115,29 @@ defineProps({
84115
85116
.card-header {
86117
display: flex;
87-
align-items: center;
118+
align-items: flex-start;
88119
gap: 8px;
89-
margin-bottom: 10px;
90120
}
91121
92122
.card-icon {
93123
font-size: 22px;
94124
}
95125
96126
.card-title {
97-
font-weight: 600;
127+
font-weight: 700;
98128
color: var(--vp-c-text-1);
99129
font-size: 17px;
100130
line-height: 1.35;
101131
letter-spacing: -0.01em;
102132
}
103133
104134
.card-arrow {
105-
color: var(--vp-c-brand-1);
106-
font-size: 15px;
107-
font-weight: 700;
108-
opacity: 0.8;
135+
color: #0066cc;
136+
font-size: 16px;
137+
font-weight: 600;
138+
opacity: 0.9;
109139
transition: transform 0.25s ease, opacity 0.25s ease;
140+
margin-top: 2px;
110141
}
111142
112143
.nav-card:hover .card-arrow {
@@ -117,6 +148,23 @@ defineProps({
117148
.card-desc {
118149
color: var(--vp-c-text-2);
119150
font-size: 14px;
120-
line-height: 1.68;
151+
line-height: 1.6;
152+
margin-top: 10px;
153+
}
154+
155+
@media (max-width: 768px) {
156+
.nav-card {
157+
border-radius: 18px;
158+
padding: 16px 18px;
159+
min-height: 108px;
160+
}
161+
162+
.card-title {
163+
font-size: 16px;
164+
}
165+
166+
.card-desc {
167+
font-size: 13px;
168+
}
121169
}
122170
</style>

docs/.vitepress/theme/components/NavGrid.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,22 @@
77
<style scoped>
88
.nav-grid {
99
display: grid;
10-
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
10+
grid-template-columns: repeat(2, minmax(0, 1fr));
1111
gap: 18px;
12-
margin: 24px 0 28px;
12+
margin: 20px 0 26px;
1313
}
1414
15-
@media (max-width: 768px) {
15+
@media (min-width: 1400px) {
16+
.nav-grid {
17+
grid-template-columns: repeat(3, minmax(0, 1fr));
18+
}
19+
}
20+
21+
@media (max-width: 900px) {
1622
.nav-grid {
1723
grid-template-columns: 1fr;
18-
gap: 14px;
19-
margin: 18px 0 24px;
24+
gap: 12px;
25+
margin: 16px 0 22px;
2026
}
2127
}
2228
</style>

docs/.vitepress/theme/style.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,15 +338,21 @@
338338

339339
.VPHomeHero .action .VPButton.alt {
340340
border-radius: 999px;
341-
border-color: #d2d2d7;
341+
border: 1px solid #0071e3;
342342
background-color: #fff;
343-
color: #1d1d1f;
344-
transition: transform 0.2s;
343+
color: #0071e3;
344+
font-weight: 500;
345+
box-shadow: none;
346+
transition:
347+
transform 0.2s,
348+
background-color 0.2s,
349+
color 0.2s;
345350
}
346351

347352
.VPHomeHero .action .VPButton.alt:hover {
348353
transform: scale(1.02);
349-
background-color: #f5f5f7;
354+
background-color: rgba(0, 113, 227, 0.08);
355+
color: #0066cc;
350356
}
351357

352358
/* HomeFeatures Sections Scroll Offset */

docs/zh-cn/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ hero:
1919
text: 开始学习
2020
link: /zh-cn/stage-0/0.1-learning-map/
2121
- theme: alt
22-
text: ⭐️ GitHub 加速更新
22+
text: GitHub 加速更新
2323
link: https://github.com/datawhalechina/easy-vibe
2424
---
2525

0 commit comments

Comments
 (0)