I think you can do some cool things when you set classes. A colon `:` indicates 'else'. {% set classes = [ item.is_expanded ? 'is-expanded' : 'not-expanded', item.is_collapsed ? 'is-collapsed' : 'not-collapsed', item.in_active_trail ? 'active', item.below ? 'has-children': 'no-children ] %}