bluegg-toggle

0.0.1 • Public • Published

Bluegg Toggle

Declarative toggle using data attributes

Wut?

The JS simply adds a class of is-toggled to a specific target(s).

Your target is specified in a data attribute (data-toggle-target="my-thing"). The target then needs to have a data-toggle-name="my-thing" attribute. The target can be a single target or comma separated list (e.g. data-toggle-target="my-thing,my-other-thing"). You can optionally specify a data-target-action="on" (on or off) that can be used to only allow the control to add/remove the is-toggled class.

Huh?

Usage in JS:

var toggle = require('bluegg-toggle');

toggle();

See here for style and markup example

Readme

Keywords

none

Package Sidebar

Install

npm i bluegg-toggle

Weekly Downloads

1

Version

0.0.1

License

ISC

Last publish

Collaborators

  • bluegg