Media group styling reference
On this page
A media group is a stack of thumbnail images on a POS screen, such as the thumbnails on the cart card or on a bundle. The first image sits on top, with the rest tucked behind it. Some media groups also show how many images are left out of the stack, such as +2 more. You can change the overlap, corners, shadow, and shading of the images in a media group, etc. Follow the POS styling API rules when you style media groups.
Where a media group appears
Media groups appear in these places:
- The cart card
- A bundle in the cart and on an order
- Above the cart actions, and on the screen for saving the cart as an open order
- The fulfillment screens
- Station tickets
- The order dialog
- The list of choices when building a bundle
- The snack bar, where the media group is also named
snack-bar-media-group
The count pinned to the corner of a media group, such as on the cart card or on a bundle, is a
badge named media-group-badge. In the snack bar, the badge is also named snack-bar-count.
Each image in a media group is a media image. A media image
property for the corners, shape, or shadow has no effect on the images in a media group when you
set it on :root. Set the property on media-group-image to change the images in media groups
only, or on media-image-root to change every image. For the corners and shape, use the media
group properties below instead, which keep each tile and the scrim matched to the image.
Parts
| Part | What it is | Available from |
|---|---|---|
media-group-root |
The whole stack, with the count of images it leaves out and anything pinned to the corner. | v22.0.17 |
media-group-image |
The tile around each image in the stack, with the corners and the scrim that darkens the images further back. The image inside is a media image. | v22.0.17 |
media-group-label |
The text beside the stack saying how many images it leaves out, such as +2 more, when a screen shows it. | v22.0.17 |
media-group-badge |
The badge pinned to the stack’s corner, when a screen gives it one, such as the count on the cart card or on a bundle. It is a badge, so style it with the badge properties. | v22.0.17 |
The Available from column shows the first release that carries the name.
Attributes
Narrow media-group-root by this, inside :where(), to style the stacks of one density.
| Attribute | Values | Default | Available from |
|---|---|---|---|
data-density |
standard, compact, comfortable, custom |
standard |
v22.0.17 |
compact: the images overlap closely, and each image further back is a little darker. Used on the cart card, bundles, station tickets, and the snack bar.comfortable: the images barely overlap, and most show how many images are left out. Used above the cart actions, on the screen for saving the cart as an open order, on the fulfillment screens, in the order dialog, and when building a bundle.custom: an overlap set for one screen. Not used on any screen yet.standard: the default overlap of the media group. Not used on any screen yet.
Component properties
Set these on media-group-root, on it narrowed by data-density, or on :root.
| Property | What it sets | Default | Available from |
|---|---|---|---|
--sc-media-group-overlap |
How far each image after the first tucks under the one before it, as a negative margin. It replaces the overlap of every density. | -8px | v22.0.17 |
--sc-media-group-overlap-step |
How much further each image tucks in than the one before it, as a share of the overlap, such as 0.1 for a tenth more each time. | 0 | v22.0.17 |
--sc-media-group-darken-step |
How much darker each image further back gets, as the strength of a dark scrim added per image. Compact stacks use 0.08 and the rest none, and a value you set replaces both. | 0 | v22.0.17 |
--sc-media-group-item-radius |
The corners of each image and its tile. | 8px | v22.0.17 |
--sc-media-group-aspect-ratio |
The shape of each image, as width / height. | 1/1 | v22.0.17 |
--sc-media-group-shadow |
The shadow under the stack, as a filter, such as drop-shadow(0 1px 2px #0003). | drop-shadow(1px 2px 2px rgb(var(–sc-color-layer-dark) / 15%)) | v22.0.17 |
--sc-media-group-label-size |
The size of the label’s text. | var(–sc-type-label-large-size) | v22.0.17 |
--sc-media-group-label-weight |
The weight of the label’s text. | var(–sc-type-label-large-weight-em) | v22.0.17 |
--sc-media-group-label-color |
The color of the label’s text. | var(–sc-color-on-surface-variant) | v22.0.17 |
Examples
Each example is tested against the POS on every change.
“Spread the images in the tight stacks out a little.”
```css
–sc-media-group-overlap: -16px; } ```
“Make the images further back in a tight stack darker.”
```css
–sc-media-group-darken-step: 0.15; } ```
“Round the images in a stack less.”
```css
part~=’media-group-root’ { –sc-media-group-item-radius: 2px; } ```
“Take the shadow off the stacks.”
```css
part~=’media-group-root’ { –sc-media-group-shadow: none; } ```
“Make the +2 more text bolder, in our brand color.”
```css
part~=’media-group-root’ { –sc-media-group-label-weight: 700; –sc-media-group-label-color: #0b5394; } ```
“Show the count on the stacks in our brand color.” Use the badge properties:
```css
[part~=’media-group-badge’] { –sc-badge-bg: #0b5394; –sc-badge-color: #ffffff; } ```
“Draw a white ring around each image in a stack.”
```css
[part~=’media-group-image’] { –sc-media-image-border: 2px solid #ffffff; } ```
What can’t be styled yet
- One stack on its own, other than the snack bar’s, since no other stack has a name yet
- The image on top apart from the others, and a new or an expired image apart from the rest: the dashed border around an expired image is the POS’s own
- A collapsed stack, or one a person can press, apart from the others
- The size of the images apart from their overlap: a size you set on the images leaves the
overlap the stack works out from its own size, so set
--sc-media-group-overlapwith it - The bounce a new image makes as it arrives, and how a stack folds up when it collapses
Retired
None yet.
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.