1.1.2 • Published 6 years ago

storm-guide v1.1.2

Weekly downloads
12
License
MIT
Repository
github
Last release
6 years ago

Storm Guide

npm version

GDS-style guide pattern implementation

Example

https://stormid.github.io/storm-guide

Usage

HTML

<div class="guide js-guide">
    <ol class="guide__navigation">
        <li class="guide__item"><a href="#section-1" class="js-guide__link guide__link">Section 1</a></li>
        <li class="guide__item"><a href="#section-2" class="js-guide__link guide__link">Section 2</a></li>
        <li class="guide__item"><a href="#section-3" class="js-guide__link guide__link">Section 3</a></li>
    </ol>
    <section id="section-1" class="tab js-guide__section guide__section">
        One
    </section>
    <section id="section-2" class="tab js-guide__section guide__section">
        Two
    </section>
    <section id="section-3" class="tab js-guide__section guide__section">
        Three
    </section>
    <div class="js-guide__incremental guide__incremental">
</div>

JS

npm i -S storm-guide

either using es6 import

import Guide from 'storm-guide';

Guide.init();

aynchronous browser loading (use the .standalone version in the /dist folder)

import Load from 'storm-load';

Load('/content/js/async/storm-guide.standalone.js')
    .then(() => {
        StormGuide.init();
    });

Options

    {
		linkClassName: '.js-guide__link',
		sectionClassName: '.js-guide__section',
		incrementalNavHolder: '.js-guide__incremental',
		activeClassName: 'active'
    }

e.g.

Guide.init({
    activeClassName: 'current'
});

Tests

npm run test

Browser support

This is module has both es6 and es5 distributions. The es6 version should be used in a workflow that transpiles.

This module depends upon Object.assign available in all evergreen browsers. ie9+ is supported with polyfills, ie8+ will work with even more polyfills for Array functions and eventListeners.

Dependencies

None

License

MIT

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.1

8 years ago

0.1.0

8 years ago