Skip to content

Commit 5bc9024

Browse files
committed
fix bg image shrinking on small layout
1 parent 3bd1f7d commit 5bc9024

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

src/global.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@
1111
.link:not(.link-uncolor) {
1212
color: var(--color-blue-500);
1313
}
14+
15+
.bg-image {
16+
@apply fixed top-0 -z-10 min-h-[100lvh] w-full object-cover object-center select-none;
17+
}

src/layouts/GlobalLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const { title, description, focus, image } = Astro.props;
2121
<head>
2222
<Meta {title} {description} image={image} />
2323
</head>
24-
<body class="min-h-full w-full">
24+
<body class="min-h-[100vh]">
2525
<ClientRouter />
2626
<Header {focus} />
2727
<slot />

src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ articles.splice(3);
3030
quality="mid"
3131
width="1920"
3232
height="1080"
33-
class="skeleton fixed top-0 -z-10 h-[100lvh] max-w-full object-cover object-center select-none"
33+
class="bg-image bg-neutral-400"
3434
src={Hero}
3535
/>
3636
<div class="absolute top-[40%] left-10 mr-10 max-w-lg bg-gray-50 p-8 pb-24">

src/pages/members.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const members = await getMembers();
2323
height="1080"
2424
quality="mid"
2525
src={Header}
26-
class="fixed top-0 -z-100 h-[100lvh] bg-neutral-400 object-cover"
26+
class="bg-image bg-neutral-400"
2727
style="object-position: 75% 20%;"
2828
aria-hidden
2929
/>

0 commit comments

Comments
 (0)