Service NSW package documentation and examples
(Login credentials required)
npm install @servicensw/navigation --save-dev
CSS
- PostCSS workflow:
@import '@servicensw/navigation';
- Sass/Eyeglass:
@import 'servicensw-navigation';
- Native CSS:
@import url('dist/navigation.css');
- Link tag:
<link href="dist/navigation.css" rel="stylesheet" type="text/css">
Vanilla JS
The recommended usage is of ES modules, to take advantage of code-splitting.
import {
StickyNav,
SecondaryNav,
TableOfContents,
} from "@servicensw/navigation"
new StickyNav("#stickyNav:not(.is-excluded)", "#stickyNavContainer")
new SecondaryNav("#secondaryNav:not(.is-excluded)")
new TableOfContents("#toc:not(.is-excluded)", "#tocContainer")
Legacy usage;
- IIFE:
<script src="dist/navigation.js" type="text/javascript"></script>
(initialized for all above elements) - Common JS:
const { StickyNav, SecondaryNav, TableOfContents } = require("@servicensw/regions")
(initialize yourself) Change log