Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/itsthatguy/simple-nav

package for creating a really simple responsive navigation
https://github.com/itsthatguy/simple-nav

Last synced: about 6 hours ago
JSON representation

package for creating a really simple responsive navigation

Awesome Lists containing this project

README

        

# simple-nav

### Installation

```
npm install simple-nav --save
```

### Javascript

#### with NPM

```javascript
SimpleNav = require('simple-nav')

myNavigation = new SimpleNav({
// defaults
scrolledClass: 'scrolled'
expandedClass: 'open'
scrollTolerance: 120
gotoSpeed: 10

gotoAnchorTimer: 500
handleScrollTimer: 300
toggleMenuTimer: 300
});
```

### Scss

```scss
$small: "only screen and (min-width: 40.063em)";

nav.primary-navigation {
> h1 {
@include inline-block;
}

> .menu {
@include inline-icon('menu');
display: block;
position: absolute;
right: 10px;
top: 10px;

span { display: none; }
}

> ul.nav-links {
display: none;
float: right;

li {
@include inline-block;
margin-right: rem-calc(10px);
margin-top: rem-calc(12px);
}
}

.button {
@include inline-block;
margin-bottom: 0;
margin-top: rem-calc(-2px);
padding: rem-calc(4px 6px);
}

@media #{$small} {
> .menu { display: none; }

> ul.nav-links {
display: block;
}
}

// When the body tag has the open class applied
body.open & {
> ul.nav-links { display: block; }
}
}
```

## Markup
```html

Title


Menu

```