Skip to content

Use a different hero image for light/dark themes. #2326

Closed Answered by HiDeoo
NThorp asked this question in Q&A
Discussion options

You must be logged in to vote

👋 The hero image accepts a dark & light variations as documented in the second example of this docs section:

---
title: Welcome to Starlight
description: Get started building your docs site with Starlight.
template: splash
hero:
  tagline: Congrats on setting up a new Starlight project!
  image:
    alt: My amazing logo
    dark: ../../assets/dark-hero.webp
    light: ../../assets/light-hero.webp
---

You can also check this Stackblitz example I made using 2 different images for the hero section.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by delucis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants