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 semantic value according to the Color (opens in a new tab) guidelines (base, accent, critical).
  • Shadow: Identified by the prefix $shadow, followed by numeric suffixes in a crescent order.
  • Z-index: Identified by the prefix $z, followed by numeric suffixes in a crescent order.

Focus Ring

As explained in the rationale (opens in a new tab), this is a web standard used in the focus state of interactive elements for users that prefer or require keyboard navigation.

Focus Ring

TokenUsage
$focus-ring-baseForm fields, actions in neutral colors (secondary and tertiary Buttons, and items in a Menu), and popovers
$focus-ring-accentActions in accent color (primary Buttons)
$focus-ring-criticalForm fields in an 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 these tokens 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

This CSS property controls the stacking order of elements on a page, measured along a z-axis. An element with a higher z-index value appears in front of another with a lower z-index value. Elements in the Admin should be 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