CSS classes

Reference of all CSS classes used by TreeNav blocks for custom styling.

All TreeNav blocks use consistent CSS classes that you can target for custom styling. Add custom CSS in your theme under Online StoreThemesEdit themeTheme settingsCustom CSS.


Tree embed

Base classes

ClassDescription
.treenavRoot nav container
.treenav--embedEmbed-specific modifier
.treenav--scrollableEnables scrolling (max_visible_items)

Header (collapsible)

ClassDescription
.treenav__headerCollapsible header button
.treenav__header--staticNon-collapsible header
.treenav__titleHeading text
.treenav__chevronCollapse indicator icon
.treenav__panelCollapsible content panel

Tree structure

ClassDescription
.treenav__treeRoot list (ul, role="tree")
.treenav__childrenChild list (ul, role="group")
.treenav__nodeNode container (li)
.treenav__rowRow wrapper (toggle + link)

Node elements

ClassDescription
.treenav__linkCollection link (a)
.treenav__link--backBack link (contextual mode)
.treenav__labelText label span
.treenav__countProduct count badge
.treenav__toggleExpand/collapse button
.treenav__iconToggle chevron icon

Data attributes (for styling)

SelectorDescription
.treenav[data-open="true"]Panel is expanded
.treenav__node[data-active="true"]Current collection
.treenav__node[data-state="open"]Node is expanded
.treenav__node[data-in-path="true"]Node is in active path
.treenav__link[aria-current="page"]Current page link

Layout modifiers (embed injection)

ClassDescription
.treenav-embed-wrapperWrapper for injected tree
.treenav--layout-sidebarSidebar layout (vertical)
.treenav--layout-topbarTopbar layout (dropdown)
.treenav--layout-drawerDrawer layout (compact)
.treenav--layout-customCustom layout (minimal)

Breadcrumb

ClassDescription
.treenav-breadcrumb-blockBlock wrapper (section level)
.treenav-breadcrumbNav container
.treenav-breadcrumb__listOrdered list (ol)
.treenav-breadcrumb__itemList item (li)
.treenav-breadcrumb__linkClickable link (a)
.treenav-breadcrumb__currentCurrent page (non-linked span)
.treenav-breadcrumb__ellipsisTruncation ellipsis item

Note: Separators are rendered via ::after pseudo-element on items, not as separate elements. Style with:

.treenav-breadcrumb__item:not(:last-child)::after {
  content: var(--bc-separator, '/');
  color: var(--bc-separator-color);
}

Drilldown

Container classes

ClassDescription
.treenav-drilldown-blockBlock wrapper (section level)
.treenav-drilldownMain container
.treenav-drilldown--centerCenter-aligned layout
.treenav-drilldown--stackedStacked/wrap display mode
.treenav-drilldown--arrows-rightArrows positioned right with fade

Structure

ClassDescription
.treenav-drilldown__wrapperFlex wrapper (contains arrows)
.treenav-drilldown__containerScroll container (nav element)
.treenav-drilldown__listPills list (ul)
.treenav-drilldown__headingOptional heading (h3)
.treenav-drilldown__heading--stickySticky heading modifier

Pill items

ClassDescription
.treenav-drilldown__itemPill link (a element)
.treenav-drilldown__item--activeCurrent collection pill
.treenav-drilldown__item--backBack/grandparent link
.treenav-drilldown__item--allAll/parent link

Scroll arrows

ClassDescription
.treenav-drilldown__scrollScroll button (base)
.treenav-drilldown__scroll--leftLeft arrow button
.treenav-drilldown__scroll--rightRight arrow button

Debug panel

Only visible when Debug mode is enabled in embed settings.

ClassDescription
.treenav-debugDebug panel container
.treenav-debug__headerHeader bar
.treenav-debug__titleTitle text
.treenav-debug__toggleCollapse toggle button
.treenav-debug__contentContent area
.treenav-debug__rowRow (label + value)
.treenav-debug__labelRow label
.treenav-debug__valueRow value
.treenav-debug__logLog messages container

Placeholder (theme editor)

Shown in theme editor when block cannot render (missing tree, wrong page, etc.).

ClassDescription
.treenav-placeholderBase placeholder
.treenav-placeholder--warningWarning style (yellow)
.treenav-placeholder--infoInfo style (blue)

Utilities

ClassDescription
.visually-hiddenScreen reader only (hidden visually)
.iconBase SVG icon (16x16)
.icon--smSmall icon (12x12)

CSS custom properties

Tree variables

.treenav {
  /* Layout */
  --treenav-font-size: 14px;
  --treenav-indent: 16px;
  --treenav-gap: 4px;
  --treenav-padding-v: 6px;
  --treenav-padding-h: 8px;
  --treenav-header-padding: 8px;
  --treenav-toggle-size: 28px;
  --treenav-icon-size: 12px;
  --treenav-radius: 6px;
  --treenav-max-items: 10;

  /* Colors */
  --treenav-text: #303030;
  --treenav-text-hover: #000000;
  --treenav-active-text: #303030;
  --treenav-hover-bg: transparent;
  --treenav-active-bg: rgba(0, 0, 0, 0.05);
  --treenav-back-text: currentColor;
  --treenav-back-bg: transparent;
  --treenav-focus: currentColor;
}

Breadcrumb variables

.treenav-breadcrumb {
  --bc-separator: '/';
  --bc-gap: 8px;
  --bc-text: #303030;
  --bc-text-hover: #000000;
  --bc-current: #707070;
  --bc-separator-color: #707070;
}

Drilldown variables

.treenav-drilldown {
  /* Layout */
  --dd-gap: 8px;
  --dd-font-size: 13px;
  --dd-radius: 20px;
  --dd-arrows-radius: 4px;
  --dd-padding-top: 8px;
  --dd-padding-bottom: 8px;

  /* Default state */
  --dd-text: #303030;
  --dd-bg: #f3f4f6;
  --dd-border: #e5e7eb;

  /* Hover state */
  --dd-text-hover: #000000;
  --dd-bg-hover: #e5e7eb;
  --dd-border-hover: #d1d5db;

  /* Active state */
  --dd-text-active: #ffffff;
  --dd-bg-active: #303030;
  --dd-border-active: #303030;

  /* Arrows */
  --dd-fade: #ffffff;
  --dd-arrow: #303030;
  --dd-arrow-bg: #ffffff;
  --dd-arrow-border: #e5e7eb;
}

Examples

Style active tree link

/* Change active collection styling */
.treenav__node[data-active="true"] > .treenav__row > .treenav__link {
  color: #your-brand-color;
  background: rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

Style breadcrumb separator

/* Use arrow separator */
.treenav-breadcrumb {
  --bc-separator: '→';
  --bc-separator-color: #999;
}

Round drilldown pills

/* Full rounded pills */
.treenav-drilldown {
  --dd-radius: 9999px;
}

/* Or target pills directly */
.treenav-drilldown__item {
  border-radius: 9999px;
}

Hide product counts

/* Hide count badges */
.treenav__count {
  display: none;
}

Custom toggle position

/* Move toggle to left side */
.treenav__row {
  flex-direction: row; /* default is row-reverse */
}

.treenav__toggle {
  margin-inline-start: 0;
  margin-inline-end: 4px;
}