Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default background-color to SideNav #873

Merged
merged 1 commit into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add default background-color
  • Loading branch information
simurai committed Aug 26, 2019
commit 6225457068901c2ecaacddfd46b9d4f4133bb140
9 changes: 4 additions & 5 deletions docs/content/components/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ Use `.UnderlineNav--full` in combination with container styles and `.UnderlineNa

The Side Nav is a vertical list of navigational links, typically used on the left side of a page. For maximum flexibility, **Side Nav elements have no default width or positioning**. We suggest using [column grid](../../objects/grid) classes or an inline `width` style for sizing, and [flexbox utilities](../../utilities/flexbox) for positioning alongside content.

- You can use a **light gray background** and a **border** if the parent element doesn't have it already.
- You can use a **border** if the parent element doesn't have it already.
- Add `aria-current="page"` to show a link as selected. Selected button elements in tab-like UIs should instead have `aria-selected="true"`.

```html live
<nav class="SideNav bg-gray-light border" style="max-width: 360px">
<nav class="SideNav border" style="max-width: 360px">
<a class="SideNav-item" href="#url">Account</a>
<a class="SideNav-item" href="#url" aria-current="page">Profile</a>
<a class="SideNav-item" href="#url">Emails</a>
Expand All @@ -268,7 +268,7 @@ The Side Nav is a vertical list of navigational links, typically used on the lef
Different kind of content can be added inside a Side Nav item. Use utility classes to further style them if needed.

```html live
<nav class="SideNav bg-gray-light border" style="max-width: 360px">
<nav class="SideNav border" style="max-width: 360px">
<a class="SideNav-item" href="#url">
Text only
</a>
Expand Down Expand Up @@ -337,14 +337,13 @@ The `.SideNav-subItem` is an alternative, more lightweight version without borde
<a class="SideNav-subItem" href="#url">Emails</a>
<a class="SideNav-subItem" href="#url">Notifications</a>
</nav>
<aside></aside>
</aside>
```

Or also appear nested, as a sub navigation. Use margin/padding utility classes to add indentation.

```html live
<nav class="SideNav bg-gray-light border" style="max-width: 360px">
<nav class="SideNav border" style="max-width: 360px">
<a class="SideNav-item" href="#url">
<!-- <%= octicon "person", class: "mr-2" %> -->
<svg width="12" height="16" viewBox="0 0 12 16" class="octicon octicon-person mr-2" aria-hidden="true">
Expand Down
4 changes: 4 additions & 0 deletions src/navigation/sidenav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
//
// A vertical list of navigational links, typically used on the left side of a page.

.SideNav {
background-color: $bg-gray-light;
}

.SideNav-item {
position: relative;
display: block;
Expand Down