You can use any kind of RubyLess code inside the condition.
Example:
<ul do='menus from root'>
<li do='each' on_if='ancestor?(main)' do='link'/>
</ul>
Read the condition as “set class to ‘on’ if the current node is an ancestor of the main node”