Skip to content

Commit

Permalink
Add top-level headers to sidenav (flutter#9161)
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough committed Jul 31, 2023
1 parent 9ef9389 commit 376ca39
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/_data/sidenav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@
permalink: /codelabs

- divider
- header: User interface

# TODO(parlough): Rename to Layouts
- title: User interface
- title: Layout
permalink: /ui/layout
children:
# TODO(parlough): Move to top-level entry
# TODO(parlough): Move to top-level entry (https://github.com/flutter/website/issues/9160)
- title: Building user interfaces
permalink: /ui
- title: Layout introduction
Expand Down Expand Up @@ -244,6 +244,7 @@
permalink: /ui/animations/overview

- divider
- header: Development

- title: Data & backend
permalink: /data-and-backend
Expand Down
4 changes: 3 additions & 1 deletion src/_includes/sidenav-level-1.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
{%- for entry in include.nav -%}
{% if entry == 'divider' -%}
<li aria-hidden="true"><div class="sidebar-primary-divider"></div></li>
{% else -%}
{% elsif entry contains 'header' -%}
<li class="nav-header">{{entry.header}}</li>
{% elsif entry contains 'children' -%}
{% assign id = 'sidenav-' | append: forloop.index -%}
{% if forloop.index == active_entries[0] -%}
{% assign isActive = true -%}
Expand Down
4 changes: 4 additions & 0 deletions src/_sass/components/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@
padding: 0 $site-sidebar-side-padding;
}

> .nav-header {
padding-top: bootstrap.bs-spacer(1);
}

> .nav-item {
&:first-child {
> .nav-link {
Expand Down

0 comments on commit 376ca39

Please sign in to comment.