Skip to content

Commit

Permalink
Merge pull request #45 from trueberryless-org/responsive-images
Browse files Browse the repository at this point in the history
Enable experimental Image cropping features from Astro 5.x
  • Loading branch information
trueberryless authored Dec 5, 2024
2 parents c47cf04 + 597736d commit 5a1f1c8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/sharp-bags-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"trueberryless": patch
---

Enable experimental Image cropping features from Astro 5.x
6 changes: 5 additions & 1 deletion src/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
import { defineConfig } from "astro/config";

// https://astro.build/config
export default defineConfig({});
export default defineConfig({
experimental: {
responsiveImages: true,
},
});
3 changes: 2 additions & 1 deletion src/src/pages/about.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import holiday from '../assets/about/about-1.jpg';
width="1553"
height="873"
src={holiday}
alt="Felix Schneider with his dads at a family holiday eating his favorite dessert, crapes."
alt="Felix Schneider looking into the distance with the Graz clock tower in the background"
priority={true}
/>
</Hero>

Expand Down
4 changes: 2 additions & 2 deletions src/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import portrait from '../assets/portrait.jpg';
alt="Felix Schneider smiling in a formal gray shirt and silver tie, arms crossed against a dark background."
width="480"
height="620"
priority={true}
src={portrait}
/>
</header>
Expand Down Expand Up @@ -121,7 +122,7 @@ import portrait from '../assets/portrait.jpg';
}

.hero img {
aspect-ratio: 5 / 4;
aspect-ratio: 3 / 4;
object-fit: cover;
object-position: top;
border-radius: 1.5rem;
Expand All @@ -143,7 +144,6 @@ import portrait from '../assets/portrait.jpg';
}

.hero img {
aspect-ratio: 3 / 4;
border-radius: 4.5rem;
object-fit: cover;
}
Expand Down

0 comments on commit 5a1f1c8

Please sign in to comment.