Skip to content
Log in

Menu styling reference

On this page

A menu is a column of things a person can do, on a raised card: the items of a group in the navigation, opened under the group’s button or floating over the page. Follow the POS styling API rules when styling it.

Where it appears

The menus the action navigation opens: a group’s items floating from the sidebar or the bar, and a group opened inside another menu, which sits on the outer menu’s card. The items are list buttons.

Parts

Part What it is Available from
menu-root The whole menu: the card with the fill, corners, and shadow, holding the items. v22.0.13

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

Attributes

Narrow menu-root by this, inside :where(), to style one kind of menu.

Attribute Values Default Available from
data-placement inline, below, beside inline v22.0.13
  • inline — in the flow of what holds it, such as a group opened inside the More menu, on that menu’s card
  • below and beside — floating over the page, below or beside the button that opened it

Component properties

Set these on menu-root to change every menu, or narrow by data-placement to change one kind. A fill set on menu-root also replaces the fill of a group with a configured color. The group’s items keep the text color chosen for the configured fill, so check that they still read on yours.

Property What it sets Default Available from
--sc-menu-bg The fill of the menu. It falls back to the overlay surface color, and a menu inside another to none. none v22.0.13
--sc-menu-width The width of a floating menu. max-content v22.0.13

Examples

Each example is tested against the POS on every change.

“Give the menus a darker fill.”

```css

part~=’menu-root’ { –sc-menu-bg: #e3e8ef; } ```

“Make the menus that open below their button wider.”

```css

–sc-menu-width: 280px; } ```

“Round the menus that open beside their button less.”

```css

border-radius: 8px; } ```

A menu that opens below a button is square where it joins the button. A border-radius on it rounds that corner too.

What can’t be styled yet

  • The corners of a menu inside another, such as a group opened in the More menu, which the navigation sets on the menu itself. A background-color set on menu-root doesn’t reach it either; set the fill with --sc-menu-bg
  • The fill of the button a floating menu opens below, which joins the menu but keeps a fill of its own, so a fill set on menu-root doesn’t reach it
  • Which side a floating menu opens toward, which follows where it is on the screen ## Retired

None yet.

Was this article helpful?

Was this article helpful?