Skip to content
Log in

Accordion styling reference

On this page

Accordions are the sections of a POS screen that operators open and close by tapping the heading, such as the notes and serial numbers on an item in the cart. You can change accordion backgrounds, borders, spacing, headings, etc. Follow the POS styling API rules when you style accordions.

Where an accordion appears

Accordions appear in these places:

  • The sections on an item’s screen in the cart, such as price adjustment, notes, and serial numbers
  • The notes on a bundle
  • Each filter in the sheet of filters for a list of records

Parts

Part What it is Available from
accordion-root The whole section, with the border and fill. v22.0.15
accordion-trigger The heading row a person presses to open or close the section. v22.0.15
accordion-icon The icon before the heading, when the section has one. v22.0.15
accordion-label The heading’s text. v22.0.15
accordion-value The short value at the end of the heading row, such as how many are set. v22.0.15
accordion-chevron The square at the end of the heading row that holds the chevron. v22.0.15
accordion-body What the section holds, drawn only while it is open. v22.0.15

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

Attributes

Narrow accordion-trigger by this, inside :where(), to style the heading row of an open or a closed section.

Attribute Values Default Available from
accordion-trigger[aria-expanded] true, false false v22.0.15

Component properties

Set these on accordion-root to change every section, or on :root.

Property What it sets Default Available from
--sc-accordion-bg The section’s fill. transparent v22.0.15
--sc-accordion-border-width The width of the border, on each side. Only the bottom edge has one unless set. 0 0 1px v22.0.15
--sc-accordion-border-style The style of the border. solid v22.0.15
--sc-accordion-border-color The color of the border. var(–sc-color-border-subtle) v22.0.15
--sc-accordion-header-gap The space between the pieces of the heading row. 8px v22.0.15
--sc-accordion-header-padding The space inside the heading row. 8px 8px 8px 12px v22.0.15
--sc-accordion-body-padding The space inside what the section holds. 0 8px 20px v22.0.15
--sc-accordion-icon-size The width and height of the icon before the heading. 24px v22.0.15
--sc-accordion-icon-stroke The stroke width of the icon before the heading. 2 v22.0.15
--sc-accordion-value-font-size The size of the value’s text. var(–sc-type-body-medium-size) v22.0.15
--sc-accordion-value-font-weight The weight of the value’s text. var(–sc-type-body-medium-weight) v22.0.15
--sc-accordion-chevron-size The width and height of the chevron. 18px v22.0.15
--sc-accordion-chevron-container-size The width and height of the square that holds the chevron. 40px v22.0.15

Examples

Each example is tested against the POS on every change.

“Give the sections a light fill.”

```css

[part~=’accordion-root’] { –sc-accordion-bg: #f4f6f8; } ```

“Make the line between sections darker and thicker.”

```css

[part~=’accordion-root’] { –sc-accordion-border-color: #9aa5b1; –sc-accordion-border-width: 0 0 2px; } ```

“Give the sections more room inside.”

```css

[part~=’accordion-root’] { –sc-accordion-header-padding: 12px 12px 12px 16px; –sc-accordion-body-padding: 0 12px 24px; } ```

“Make the headings bolder.”

```css

[part~=’accordion-label’] { font-weight: 700; } ```

“Tint the heading of a section that is open.”

```css

background-color: #e3e8ef; } ```

“Make the chevron’s square round, in our brand color.”

```css

[part~=’accordion-chevron’] { border-radius: 999px; color: #0b5394; } ```

What can’t be styled yet

  • One section on its own, such as the notes, since no section has a name yet
  • The whole of an open section, apart from a closed one: only the heading row says which it is
  • The chevron’s square while it’s hovered, apart from the other states: a fill or color you set on it also replaces the ones it takes while hovered
  • A filter’s section in the sheet of filters, whose white fill the POS sets itself and which wins over the fill property

Retired

None yet.

Was this article helpful?

Was this article helpful?