diff --git a/material/templates/partials/nav-item.html b/material/templates/partials/nav-item.html index d127bb16c..08752b760 100644 --- a/material/templates/partials/nav-item.html +++ b/material/templates/partials/nav-item.html @@ -53,20 +53,33 @@ {% endif %} {% endfor %} {% endif %} - {% set tabs = "navigation.tabs" in features %} - {% set sections = "navigation.sections" in features %} - {% if tabs and level == 1 or sections and tabs >= level - 1 %} - {% set class = class ~ " md-nav__item--section" %} - {% set is_section = true %} - {% elif not nav_item.active and "navigation.prune" in features %} - {% set class = class ~ " md-nav__item--pruned" %} - {% set is_pruned = true %} + {% if "navigation.tabs" in features %} + {% if level == 1 and nav_item.active %} + {% set class = class ~ " md-nav__item--section" %} + {% set is_section = true %} + {% endif %} + {% if "navigation.sections" in features %} + {% if level == 2 and nav_item.parent.active %} + {% set class = class ~ " md-nav__item--section" %} + {% set is_section = true %} + {% endif %} + {% endif %} + {% elif "navigation.sections" in features %} + {% if level == 1 %} + {% set class = class ~ " md-nav__item--section" %} + {% set is_section = true %} + {% endif %} + {% endif %} + {% if "navigation.prune" in features %} + {% if not is_section and not nav_item.active %} + {% set class = class ~ " md-nav__item--pruned" %} + {% set is_pruned = true %} + {% endif %} {% endif %}