---
title: "Media gallery styling reference"
source: https://support.storeconnect.com/articles/pos-media-gallery-styling-reference
type: article
format: markdown
site: StoreConnect Support — product and developer documentation for StoreConnect
site_index: https://storeconnect.com/llms.txt
docs_index: https://support.storeconnect.com/llms.txt
note: Append .md to any page or article URL on this site to get its Markdown form.
---
# Media gallery styling reference

A media gallery shows a record's images one at a time, such as the pictures on a product's page. Operators swipe the frame to move between images, or tap a thumbnail to pick one. You can change the size, shape, corners, and shadow of the media gallery frame, the size and border of the thumbnails, etc. Follow the [POS styling API](pos-styling-api#rules) rules when you style media galleries.

## Where a media gallery appears

Media galleries appear in these places:

- On a product's page and in the bundle dialog. When the product has more than one image, the media gallery has a row of thumbnails under the frame, and previous and next buttons on the frame. In the bundle dialog, the frame has a shadow.
- On a product card with more than one image, in place of the card's image. Operators swipe the image, and there are no dots or buttons. The frame is 1.3 / 1 here, inside the card's `card-image` part, so the card image properties set the shape of each image.

No screen shows the media gallery dots yet. Media galleries on a product's page and in the bundle dialog show thumbnails instead, and media galleries on product cards have no dots.

Each image in a media gallery frame and in the thumbnails is a [media image](pos-media-image-styling-reference). The media gallery sets the size and corners of these images, and the fit of the image in the frame, so media image properties for these set on `:root` do not change them. A fit set on `:root` does change the thumbnails. To change the images in media galleries only, set the properties on `media-gallery-frame` or `media-gallery-thumbnail`.

On a product's page and in the bundle dialog, the screen sets the corners of the frame and, on a small screen, the maximum height of the frame. `--sc-media-gallery-radius` and `--sc-media-gallery-max-height` set on `:root` do not change these, so set them on `media-gallery-root` instead.

The swipe track inside a media gallery frame is a [pager](pos-pager-styling-reference), so a rule for `pager-root` styles it along with every other pager.

## Parts

| Part | What it is | Available from |
| --- | --- | --- |
| `media-gallery-root` | The whole gallery: the image showing and, under it, the strip of thumbnails when the screen shows one. | v22.0.19 |
| `media-gallery-frame` | The box the image showing fills, with the corners and shadow, which operators swipe to see the next image. Each image in it is a media image. | v22.0.19 |
| `media-gallery-previous-button` | The button on the frame that shows the image before, which appears while the pointer is over a gallery of more than one image. It is a [button](pos-button-styling-reference), so the button properties apply to it. | v22.0.19 |
| `media-gallery-next-button` | The button on the frame that shows the image after, which appears while the pointer is over a gallery of more than one image. It is a [button](pos-button-styling-reference), so the button properties apply to it. | v22.0.19 |
| `media-gallery-indicator` | The row of dots at the foot of the frame, one for each image, on a gallery of more than one image without thumbnails. Not used on any screen yet. | v22.0.19 |
| `media-gallery-dot` | One dot, standing for one image. Not used on any screen yet. | v22.0.19 |
| `media-gallery-thumbnails` | The strip of thumbnails under the frame, on a gallery of more than one image whose screen shows them. | v22.0.19 |
| `media-gallery-thumbnail` | One thumbnail, which shows the thumbnail's image in the frame when pressed. The image in it is a media image. | v22.0.19 |

The **Available from** column shows the first release that carries the name.

## Attributes

Narrow `media-gallery-dot` or `media-gallery-thumbnail` by these, inside `:where()`, to style the
one for the image showing.

| Attribute | Values | Default | Available from |
| --- | --- | --- | --- |
| `media-gallery-dot[data-active]` | `true`, `false` | `false` | v22.0.19 |
| `media-gallery-thumbnail[aria-current]` | `true`, `false` | `false` | v22.0.19 |

## Component properties

Set these on `media-gallery-root` or on `:root`.

| Property | What it sets | Default | Available from |
| --- | --- | --- | --- |
| `--sc-media-gallery-max-width` | The widest the gallery gets. | 400px | v22.0.19 |
| `--sc-media-gallery-max-height` | The tallest the image showing gets. The gallery narrows to keep the screen's shape for the frame, so the frame doesn't grow past it unless you also set `--sc-media-gallery-aspect-ratio`. | 100vh | v22.0.19 |
| `--sc-media-gallery-aspect-ratio` | The shape of the frame, as width / height, in place of the screen's: 1/1, or 1.3 / 1 on a product card. | 1/1 | v22.0.19 |
| `--sc-media-gallery-radius` | The corners of the frame. | unset | v22.0.19 |
| `--sc-media-gallery-shadow` | The shadow around the frame, as a box shadow. | none | v22.0.19 |
| `--sc-media-gallery-gap` | The space between the frame and the strip of thumbnails. | var(--sc-spacing-3) | v22.0.19 |
| `--sc-media-gallery-nav-indicator-size` | The width and height of each dot. Not used on any screen yet. | 8px | v22.0.19 |
| `--sc-media-gallery-thumbnail-size` | The width and height of each thumbnail. | 56px | v22.0.19 |
| `--sc-media-gallery-thumbnail-border` | The border around each thumbnail. | 1px solid rgb(var(--sc-color-layer-dark) / 12%) | v22.0.19 |

## Examples

Each example is tested against the POS on every change.

**"Round the gallery's corners and drop the shadow."**

```css

[part~='media-gallery-root'] {
  --sc-media-gallery-radius: 12px;
  --sc-media-gallery-shadow: none;
}
```

**"Keep the gallery narrower."**

```css

[part~='media-gallery-root'] {
  --sc-media-gallery-max-width: 280px;
}
```

**"Make the thumbnails bigger, with a lighter border."**

```css

[part~='media-gallery-root'] {
  --sc-media-gallery-thumbnail-size: 72px;
  --sc-media-gallery-thumbnail-border: 1px solid #e0e0e0;
}
```

**"Ring the thumbnail of the image showing in our brand color."**

```css

[part~='media-gallery-thumbnail']:where([aria-current='true']) {
  outline-color: #0b5394;
}
```

**"Show the dot for the image showing in full."**

```css

[part~='media-gallery-dot']:where([data-active='true']) {
  opacity: 1;
}
```

**"Make the previous and next buttons our brand color."** They are buttons, so set the button
properties:

```css

[part~='media-gallery-previous-button'],
[part~='media-gallery-next-button'] {
  --sc-button-bg: #0b5394;
  --sc-button-color: #ffffff;
}
```

**"Take the background off the strip of thumbnails."**

```css

[part~='media-gallery-thumbnails'] {
  background-color: transparent;
}
```

## What can't be styled yet

- The gallery on a product card apart from the one on a product's page or the bundle's dialog,
  since no screen gives it a name yet
- The swipe track inside the frame alone, apart from every other pager
- How the previous and next buttons slide in while the pointer is over the gallery
- Where the previous and next buttons sit on the frame, and where the dots sit
- The height cap's arithmetic when you set the frame's shape: the gallery works out the narrowing
  from the screen's shape, not yours

## Retired

None yet.

---

## Follow StoreConnect

- [Email Newsletter](https://storeconnect.com/c/lp-newsletter)
- [LinkedIn Newsletter](https://www.linkedin.com/build-relation/newsletter-follow?entityUrn=7444956928444862464)
- [YouTube](https://www.youtube.com/channel/UCngKdP2x8l1wcbAKW3tvU8g)
- [LinkedIn](https://www.linkedin.com/company/storeconnect)
- [X / Twitter](https://x.com/storeconnecthq)

## Popular Links

- [Partners](https://storeconnect.com/partners)
- [Become a Partner](https://storeconnect.com/become-a-partner)
- [News](https://storeconnect.com/articles/news)
- [Events](https://storeconnect.com/articles/events)
- [Feature Comparison](https://storeconnect.com/how-we-compare)
- [Download a free trial](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FMkeKUAT)
- [Book a Demo](https://storeconnect.com/contact)

## Documentation

- [Help documentation](https://support.storeconnect.com/help-documentation)
- [AI agents](https://support.storeconnect.com/ai)
- [Videos & tutorials](https://support.storeconnect.com/videos-tutorials)
- [Developer reference](https://support.storeconnect.com/developer-reference)
- [Release notes](https://support.storeconnect.com/release-notes)
- [Troubleshooting](https://support.storeconnect.com/troubleshooting)
- [Trust Center](https://trust.getstoreconnect.com/)
- [Status Page](https://status.storeconnect.com/)

## Contact

- info@getstoreconnect.com
- US +1 415 745 3230
- AUS +61 2 8365 2308

100 S Ashley Dr, Suite 600-2461
Tampa FL 33602-600 USA

Level 22, Sydney Place
180 George Street
Sydney, NSW, 2000, AUS

## Machine-readable

- [Site index for agents](https://storeconnect.com/llms.txt): curated map of the StoreConnect site in llms.txt format
- [Documentation index for agents](https://support.storeconnect.com/llms.txt): full technical and product documentation map

Every page and article on this site has a Markdown rendering: append `.md` to its URL.

Continue in Markdown: [Help documentation](https://support.storeconnect.com/help-documentation.md) · [Developer reference](https://support.storeconnect.com/developer-reference.md) · [Videos & tutorials](https://support.storeconnect.com/videos-tutorials.md) · [Release notes](https://support.storeconnect.com/release-notes.md)

---

StoreConnect Support — https://support.storeconnect.com/articles/pos-media-gallery-styling-reference