Skip to content

Commit f1b5cf4

Browse files
committed
refactor: migrate SFC styles to UnoCSS and refresh projects
1 parent 126a69e commit f1b5cf4

19 files changed

Lines changed: 1147 additions & 1088 deletions

‎.vscode/settings.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,18 @@
2525
"cSpell.useGitignore": true,
2626
"cSpell.allowCompoundWords": true,
2727
"cSpell.words": [
28+
"antfu",
2829
"bilibili",
2930
"bumpp",
3031
"changelogithub",
3132
"esbuild",
33+
"gdfmt",
3234
"gstatic",
3335
"iconify",
3436
"nuxt",
3537
"nuxtjs",
3638
"oxfmt",
39+
"rivu",
3740
"shiki",
3841
"unocss",
3942
"unrs",

‎app/components/home/Footer.vue‎

Lines changed: 10 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,24 @@ const commitUrl = computed(() => {
1212
</script>
1313

1414
<template>
15-
<footer class="site-footer">
16-
<div class="site-frame footer-inner">
17-
<p>CC BY-NC-SA 4.0 2024—PRESENT © ntnyq</p>
18-
<div>
15+
<footer class="mt-auto pb-10 pt-8">
16+
<div
17+
class="site-frame flex flex-col items-start justify-between gap-4 sm:flex-row sm:items-center"
18+
>
19+
<p class="m-0 text-0.78rem text-$c-muted">
20+
CC BY-NC-SA 4.0 2024—PRESENT © ntnyq
21+
</p>
22+
<div class="flex items-center gap-4">
1923
<NuxtLink
2024
to="/sponsor"
21-
class="soft-link"
25+
class="soft-link m-0 text-0.78rem text-$c-muted"
2226
>
2327
Sponsor
2428
</NuxtLink>
2529
<NuxtLink
2630
v-if="commitUrl && shortCommitSha"
2731
:to="commitUrl"
28-
class="soft-link"
32+
class="soft-link m-0 text-0.78rem text-$c-muted"
2933
target="_blank"
3034
rel="noopener noreferrer"
3135
external
@@ -36,39 +40,3 @@ const commitUrl = computed(() => {
3640
</div>
3741
</footer>
3842
</template>
39-
40-
<style scoped>
41-
.site-footer {
42-
margin-top: auto;
43-
padding-block: 2rem 2.5rem;
44-
}
45-
46-
.footer-inner,
47-
.footer-inner div {
48-
display: flex;
49-
align-items: center;
50-
}
51-
52-
.footer-inner {
53-
justify-content: space-between;
54-
gap: 1rem;
55-
}
56-
57-
.footer-inner div {
58-
gap: 1rem;
59-
}
60-
61-
.footer-inner p,
62-
.footer-inner a {
63-
margin: 0;
64-
color: var(--c-muted);
65-
font-size: 0.78rem;
66-
}
67-
68-
@media (max-width: 520px) {
69-
.footer-inner {
70-
align-items: flex-start;
71-
flex-direction: column;
72-
}
73-
}
74-
</style>

‎app/components/home/Hero.vue‎

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
<template>
2-
<section class="hero prose">
3-
<h1>Hi, I'm ntnyq</h1>
4-
<p>
2+
<section class="pt-10 prose">
3+
<h1 class="m-0 mb-6 text-2rem">Hi, I'm ntnyq</h1>
4+
<p class="m-0 mb-1.1rem">
55
A front-end developer. I spend most of my time with
66
<strong>TypeScript</strong>, <strong>Vue</strong>, and the tooling around
77
them.
88
</p>
9-
<p>
9+
<p class="m-0 mb-1.1rem">
1010
I maintain
1111
<NuxtLink to="/projects">open-source projects</NuxtLink>
1212
for linting, parsing, types, and browser extensions. This is where I keep
1313
the things I build and the
1414
<NuxtLink to="/posts">notes</NuxtLink>
1515
I write along the way.
1616
</p>
17-
<p>
17+
<p class="m-0 mb-1.1rem">
1818
Currently learning TypeScript and Nuxt, while maintaining a small family
1919
of developer tools.
2020
</p>
21-
<p class="find-me">
21+
<p class="m-0 mb-1.1rem flex flex-wrap items-center gap-x-4 gap-y-0.4rem">
2222
Find me on
2323
<a
2424
href="https://github.com/ntnyq"
25+
class="inline-flex items-center gap-0.35rem"
2526
target="_blank"
2627
rel="noopener noreferrer"
2728
>
@@ -33,6 +34,7 @@
3334
</a>
3435
<a
3536
href="https://bsky.app/profile/ntnyq.com"
37+
class="inline-flex items-center gap-0.35rem"
3638
target="_blank"
3739
rel="noopener noreferrer"
3840
>
@@ -44,6 +46,7 @@
4446
</a>
4547
<a
4648
href="https://twitter.com/ntnyq"
49+
class="inline-flex items-center gap-0.35rem"
4750
target="_blank"
4851
rel="noopener noreferrer"
4952
>
@@ -55,6 +58,7 @@
5558
</a>
5659
<a
5760
href="https://space.bilibili.com/40199161"
61+
class="inline-flex items-center gap-0.35rem"
5862
target="_blank"
5963
rel="noopener noreferrer"
6064
>
@@ -65,38 +69,10 @@
6569
Bilibili
6670
</a>
6771
</p>
68-
<p class="muted-copy">
72+
<p class="m-0 mb-1.1rem text-$c-muted">
6973
If my work has helped you, consider
7074
<NuxtLink to="/sponsor">sponsoring me</NuxtLink>
7175
to keep it sustainable.
7276
</p>
7377
</section>
7478
</template>
75-
76-
<style scoped>
77-
.hero {
78-
padding-top: 2.5rem;
79-
}
80-
81-
.hero h1 {
82-
margin: 0 0 1.5rem;
83-
font-size: 2rem;
84-
}
85-
86-
.hero p {
87-
margin: 0 0 1.1rem;
88-
}
89-
90-
.find-me {
91-
display: flex;
92-
align-items: center;
93-
flex-wrap: wrap;
94-
gap: 0.4rem 1rem;
95-
}
96-
97-
.find-me a {
98-
display: inline-flex;
99-
align-items: center;
100-
gap: 0.35rem;
101-
}
102-
</style>

‎app/components/home/ProjectItem.vue‎

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,15 @@ defineProps<{
99
<template>
1010
<a
1111
:href="item.url"
12-
class="project-card focus-ring"
12+
class="block rounded-lg px-4 py-0.8rem no-underline opacity-85 transition-[background-color,opacity] duration-200 ease-[ease] hover:bg-$c-hover-bg hover:opacity-100 focus-ring"
1313
target="_blank"
1414
rel="noopener noreferrer"
1515
>
16-
<span class="project-name">{{ item.name }}</span>
17-
<span class="project-description">{{ item.description }}</span>
16+
<span class="block text-0.95rem text-$c-fg-deep font-500">{{
17+
item.name
18+
}}</span>
19+
<span class="mt-0.3rem block text-0.82rem text-$c-muted leading-[1.55]">{{
20+
item.description
21+
}}</span>
1822
</a>
1923
</template>
20-
21-
<style scoped>
22-
.project-card {
23-
display: block;
24-
border-radius: 0.5rem;
25-
padding: 0.8rem 1rem;
26-
text-decoration: none;
27-
opacity: 0.85;
28-
transition:
29-
background-color 0.2s ease,
30-
opacity 0.2s ease;
31-
}
32-
33-
.project-card:hover {
34-
background: var(--c-hover-bg);
35-
opacity: 1;
36-
}
37-
38-
.project-name {
39-
display: block;
40-
color: var(--c-fg-deep);
41-
font-size: 0.95rem;
42-
font-weight: 500;
43-
}
44-
45-
.project-description {
46-
display: block;
47-
margin-top: 0.3rem;
48-
color: var(--c-muted);
49-
font-size: 0.82rem;
50-
line-height: 1.55;
51-
}
52-
</style>

‎app/components/home/Projects.vue‎

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { FEATURED_PROJECTS } from '~/utils/portfolio'
33
</script>
44

55
<template>
6-
<section class="home-projects">
7-
<h2>Projects</h2>
6+
<section class="pb-12 pt-10">
7+
<h2 class="m-0 mb-4 text-1.25rem text-$c-fg-deep font-500">Projects</h2>
88

9-
<div class="projects-list">
9+
<div class="grid grid-cols-1 mx--4 gap-x-4 gap-y-1 sm:grid-cols-2">
1010
<ProjectItem
1111
v-for="item in FEATURED_PROJECTS"
1212
:key="item.name"
@@ -16,7 +16,7 @@ import { FEATURED_PROJECTS } from '~/utils/portfolio'
1616

1717
<NuxtLink
1818
to="/projects"
19-
class="soft-link all-link focus-ring"
19+
class="soft-link mt-5 inline-flex items-center gap-0.35rem text-0.9rem focus-ring"
2020
>
2121
All projects
2222
<span
@@ -26,37 +26,3 @@ import { FEATURED_PROJECTS } from '~/utils/portfolio'
2626
</NuxtLink>
2727
</section>
2828
</template>
29-
30-
<style scoped>
31-
.home-projects {
32-
padding-block: 2.5rem 3rem;
33-
}
34-
35-
.home-projects h2 {
36-
margin: 0 0 1rem;
37-
color: var(--c-fg-deep);
38-
font-size: 1.25rem;
39-
font-weight: 500;
40-
}
41-
42-
.projects-list {
43-
display: grid;
44-
grid-template-columns: repeat(2, minmax(0, 1fr));
45-
gap: 0.25rem 1rem;
46-
margin-inline: -1rem;
47-
}
48-
49-
.all-link {
50-
display: inline-flex;
51-
align-items: center;
52-
gap: 0.35rem;
53-
margin-top: 1.25rem;
54-
font-size: 0.9rem;
55-
}
56-
57-
@media (max-width: 620px) {
58-
.projects-list {
59-
grid-template-columns: 1fr;
60-
}
61-
}
62-
</style>

0 commit comments

Comments
 (0)