Tag styling reference
On this page
Tags are the small labels on a POS screen that show operators a status or a detail, such as an order’s status, a product’s stock, or Partly paid on an item on an order. Operators can read tags but can’t tap them. You can change tag colors, borders, corners, text size, icon size, etc. Follow the POS styling API rules when you style tags.
Where a tag appears
Tags appear on many POS screens. For example:
- The status of an order, and the status of each payment on the order
- The status of a fulfillment
- A product’s stock, such as In stock or Not tracked
- A price adjustment on an item in the cart
- Partly paid on an item on an order
- The tag on a product card
- Default beside the default printer in the Hardware settings
- Degraded, Disabled, or Offline on a fulfillment station
- A record’s tag fields, in the record’s row, card, and page
Parts
| Part | What it is | Available from |
|---|---|---|
tag-root |
The whole tag: the fill, border, corners, and text. | v22.0.19 |
tag-icon |
The icon before the text, on a tag that shows one. | v22.0.19 |
The Available from column shows the first release that carries the name.
Attributes
To style one kind of tag, narrow tag-root by one of these attributes, inside :where().
| Attribute | Values | Default | Available from |
|---|---|---|---|
data-size |
small, medium, large |
medium |
v22.0.19 |
data-variant |
filled, text, outlined |
filled |
v22.0.19 |
data-theme |
alert, brand, inverse, neutral, notify, success |
brand |
v22.0.19 |
The values of data-size and data-theme are always lowercase, so match them in lowercase.
data-variant sets how a tag looks:
filled: a fill in the theme’s color.text: plain text with no fill and no border, in the color of the text around the tag.outlined: a dashed border around a softer fill.
data-theme sets what a tag means, and so the tag colors:
brand: a soft fill in the primary color. An outlined brand tag has a primary border.neutral: a quiet surface fill. An outlined neutral tag has a gray border.alert: the error color, for something that needs attention, such as a price adjustment. An outlined alert tag has a soft fill with red text.notify: the same asalerton a filled tag.success: a soft green fill.inverse: a dark fill with light text.
Only the brand, neutral, and alert themes have colors for an outlined tag. An outlined tag with another theme has a dashed border and none of the theme colors.
Component properties
Set these on tag-root to change every tag. The small, medium, and large sizes each have separate text properties, and a large tag has separate padding, corner, and icon properties, so set the property for the size you want to change.
A filled or outlined tag uses the theme colors, so --sc-tag-color, --sc-tag-bg, and --sc-tag-border-color apply only to a tag whose theme sets no color. To color a themed tag, style tag-root directly, narrowed by data-theme.
| Property | What it sets | Default | Available from |
|---|---|---|---|
--sc-tag-gap |
The space between the icon and the text. | 3px |
v22.0.19 |
--sc-tag-color |
The text and icon color, on a tag whose theme sets none: a text tag, or an outlined tag with the inverse, notify, or success theme. |
inherit |
v22.0.19 |
--sc-tag-bg |
The fill, on a tag whose theme sets none: a text tag, or an outlined tag with the inverse, notify, or success theme. |
transparent |
v22.0.19 |
--sc-tag-border-width |
The width of the border, on every tag except a filled brand tag. | 1px |
v22.0.19 |
--sc-tag-border-style |
The style of the border, on a text tag and on a filled tag other than a brand tag. An outlined tag’s border is always dashed. | solid |
v22.0.19 |
--sc-tag-border-color |
The color of the border, on a tag whose theme sets none: a text tag, a filled tag other than a brand tag, or an outlined tag with the inverse, notify, or success theme. |
transparent |
v22.0.19 |
--sc-tag-padding |
The space inside a small or medium tag, around the text. | 1px 3px |
v22.0.19 |
--sc-tag-border-radius |
How round the corners of a small or medium tag are. | 5px |
v22.0.19 |
--sc-tag-font-size |
The text size of a medium tag. | var(--sc-type-label-medium-size) |
v22.0.19 |
--sc-tag-font-weight |
The text weight of a medium tag. | var(--sc-type-label-medium-weight) |
v22.0.19 |
--sc-tag-line-height |
The line height of a medium tag. | var(--sc-type-label-medium-line-height) |
v22.0.19 |
--sc-tag-icon-size |
The width and height of the icon on a small or medium tag. | 14px |
v22.0.19 |
--sc-tag-icon-stroke |
The stroke width of the icon. | 2 |
v22.0.19 |
--sc-tag-small-font-size |
The text size of a small tag. | var(--sc-type-label-small-size) |
v22.0.19 |
--sc-tag-small-font-weight |
The text weight of a small tag. | var(--sc-type-label-small-weight) |
v22.0.19 |
--sc-tag-small-line-height |
The line height of a small tag. | var(--sc-type-label-small-line-height) |
v22.0.19 |
--sc-tag-large-padding |
The space inside a large tag, around the text. | 2px 4px |
v22.0.19 |
--sc-tag-large-border-radius |
How round the corners of a large tag are. | 6px |
v22.0.19 |
--sc-tag-large-font-size |
The text size of a large tag. | var(--sc-type-label-large-size) |
v22.0.19 |
--sc-tag-large-font-weight |
The text weight of a large tag. | var(--sc-type-label-large-weight) |
v22.0.19 |
--sc-tag-large-line-height |
The line height of a large tag. | var(--sc-type-label-large-line-height) |
v22.0.19 |
--sc-tag-large-icon-size |
The width and height of the icon on a large tag. | 16px |
v22.0.19 |
Examples
Each example is tested against the POS on every change.
“Make the tags’ corners squarer.” A large tag has a separate corner property:
```css
part~=’tag-root’ { –sc-tag-border-radius: 2px; –sc-tag-large-border-radius: 3px; } ```
“Give the tags a little more room.”
```css
part~=’tag-root’ { –sc-tag-padding: 2px 6px; –sc-tag-large-padding: 3px 8px; } ```
“Make the small tags easier to read.”
```css
part~=’tag-root’ { –sc-tag-small-font-size: 12px; –sc-tag-small-font-weight: 600; } ```
“Make the brand tags our brand color.” A themed tag uses the theme colors, so style the part, narrowed by the theme and by how the tag looks:
```css
background-color: #0b5394; color: #ffffff; } ```
“Make the alert tags a softer red.”
```css
background-color: #d14343; } ```
“Give the outlined tags a solid border.”
```css
border-style: solid; } ```
“Color the tags drawn as plain text.”
```css
–sc-tag-color: #0b5394; } ```
“Make the icons in tags thinner.”
```css
part~=’tag-root’ { –sc-tag-icon-stroke: 1.5; } ```
What can’t be styled yet
- One tag alone, such as an order’s status or Default on a printer, since no tag has a name yet. A tag inside another component, such as a labeled value or an item’s details, has no name from that component either.
- The colors of a filled or outlined tag through the tag properties. These tags use the fill, text color, and border color of the theme, so style
tag-rootfor those, narrowed bydata-theme. - The text apart from the icon, since the text has no separate part.
- A tag with a theme this page doesn’t list, such as the layby tag on the checkout summary, apart from other tags. That tag still follows
tag-root. - The corners and padding of a fulfillment’s status tag through the tag properties, since the fulfillment screens set the corners and padding. Style
tag-rootdirectly for that tag.
Retired
None yet.
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.