-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adds the
--starlight-image-zoom-backdrop-bg
CSS custom proper…
…ty to customize the backdrop background color of zoomed images
- Loading branch information
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
title: Customization | ||
description: Learn how to customize the appearance of zoomed images. | ||
--- | ||
|
||
Zoomed images are displayed in a modal [`<dialog>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog) which includes a backdrop displayed behind the image. | ||
|
||
## Customizing the backdrop | ||
|
||
By default, the backdrop background color is an non-transparent color based on Starlight's color palette. | ||
You can customize this color using the `--starlight-image-zoom-backdrop-bg` CSS custom property. | ||
|
||
To learn how to add custom CSS styles to Starlight, refer to the [“Custom CSS styles”](https://starlight.astro.build/guides/css-and-tailwind/#custom-css-styles) guide in the Starlight documentation. | ||
|
||
```css | ||
:root { | ||
/* Custom backdrop background color in dark mode. */ | ||
--starlight-image-zoom-backdrop-bg: oklch(0 0 0); | ||
} | ||
|
||
:root[data-theme='light'] { | ||
/* Custom backdrop background color in light mode. */ | ||
--starlight-image-zoom-backdrop-bg: oklch(100% 0 0); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters