Foundations
Best Practices

Best Practices

Elevation tokens are divided in three types:

  • Focus Ring – Identified by the prefix $focus-ring followed by a suffix that indicates the the semantic value according to the colors guidelines (base, accent, or critical).
  • Shadow – Identified by the prefix $shadow followed by suffixes that are numbers that are agnostic to the token value, they just represent a crescent order.
  • Z-index – Identified by the prefix $z followed by suffixes that are numbers that are agnostic to the token value, they just represent a crescent order.

Focus Ring

Include focus states for merchants that prefer or require keyboard navigation (a web standard mentioned in the rationale (opens in a new tab)) and to highlight error states on form fields.

Focus Ring

TokenUsage
$focus-ring-baseFocus ring of form fields, actions in neutral colors (Secondary and Tertiary Buttons, and items in a Menu), and popovers
$focus-ring-accentFocus ring of actions in accent color (Primary Buttons)
$focus-ring-criticalFocus ring of form fields in error state and actions in critical colors (Critical Buttons and critical items in a Menu)

Shadow

As mentioned in the rationale (opens in a new tab), use shadows to indicate that an element is over another and there is content hidden below it.

Shadow

TokenUsage
$shadow-1Popovers
$shadow-2Modal, Drawer, and Toast

Z-index

Z-index is the CSS property that controls the stacking order of elements on a page, measured along the z-axis. A higher z-index value means that an element will appear in front of another with a lower z-index value. Elements in the Admin are stacked as described below.

Z-index

TokenUsage
$z-1Page Content, Page Header
$z-2Drawer Backdrop
$z-3Drawer
$z-4Modal Backdrop
$z-5Modal
$z-6Popover
$z-7Toast
$z-8No scenarios mapped
$z-9Tooltip
$z-10Floating contextual help