Skip to content

Commit b1d5c36

Browse files
committed
perf: use responsive image and reduce @import tailwindcss, dev: use contentIntellisense
1 parent 56ef8bf commit b1d5c36

File tree

6 files changed

+13
-23
lines changed

6 files changed

+13
-23
lines changed

astro.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ export default defineConfig({
2727

2828
prefetch: {
2929
prefetchAll: true,
30-
defaultStrategy: "viewport", //
30+
defaultStrategy: "hover",
31+
},
32+
image: {
33+
experimentalLayout: "responsive",
3134
},
3235
experimental: {
3336
clientPrerender: true,
37+
responsiveImages: true,
38+
contentIntellisense: true,
3439
},
3540
});

src/components/ArticleList.astro

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,9 @@ const articlesWithExcerpts = await Promise.all(
9090
}
9191
</ul>
9292
<style>
93-
@import "tailwindcss";
9493
@media (max-width: 64rem) {
9594
.variant-compact :nth-child(n + 3) a {
96-
@apply hidden;
97-
}
98-
}
99-
@media (max-width: 80rem) {
100-
.variant-compact :nth-child(n + 4) a {
101-
@apply hidden;
95+
display: none;
10296
}
10397
}
10498
</style>

src/components/Header.astro

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
import { ClientRouter, fade } from "astro:transitions";
32
import { Icon } from "astro-icon/components";
43
54
import banner from "../content/banner.ts";
@@ -49,7 +48,7 @@ const { focus } = Astro.props;
4948
)
5049
}
5150
<div class="flex h-16">
52-
<a href="/" class="flex items-center px-4" data-astro-prefetch="load">
51+
<a href="/" class="flex items-center px-4" data-astro-prefetch="viewport">
5352
<Logo class="ml-8 w-36" variant="default" />
5453
</a>
5554
<div aria-hidden="true" class="flex-grow"></div>
@@ -91,7 +90,7 @@ const { focus } = Astro.props;
9190
<a
9291
href={link.to}
9392
class="block px-4 py-2"
94-
data-astro-prefetch="load"
93+
data-astro-prefetch="viewport"
9594
>
9695
{link.title}
9796
</a>

src/components/ProjectList.astro

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,14 @@ if (variant === "compact") {
6262
</ul>
6363

6464
<style>
65-
@import "tailwindcss";
6665
@media (max-width: 64rem) {
6766
li.variant-short:nth-child(n + 3) {
68-
@apply hidden;
67+
display: none;
6968
}
7069
}
7170
@media (max-width: 80rem) {
7271
li.variant-short:nth-child(n + 5) {
73-
@apply hidden;
72+
display: none;
7473
}
7574
}
7675
</style>

src/layouts/GlobalLayout.astro

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,7 @@ const { title, description, focus } = Astro.props;
2121
<slot />
2222
<Footer />
2323
<style is:global>
24-
@import "tailwindcss";
25-
@plugin "@tailwindcss/typography";
26-
27-
/* do we need this? */
28-
:root {
29-
--color-primary-main: #00d372;
30-
}
24+
@import "../global.css";
3125
</style>
3226
</body>
3327
</html>

src/pages/donation.astro

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@ import DonationHeader from "../images/donation-header.jpg";
7373
</article>
7474

7575
<style>
76-
@import "tailwindcss";
7776
article {
78-
@apply mx-[20%];
77+
margin-inline: 20%;
7978
}
8079
</style>
8180
</GlobalLayout>

0 commit comments

Comments
 (0)