Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

resize-cursors

1.0.0 • Public • Published

resize-cursors

Get a CSS cursor style given top/bottom/left/right cursor positional state relative to a DOM element.

npm Version Build Status Test Coverage Dependency Status

Installation

Install using npm:

$ npm install resize-cursors

Usage

resize-cursors takes cursor positional state relative to a DOM node and returns a CSS cursor style that makes sense for that state. States that don't imply a resize (i.e., false for all edges), as well as states that don't make much sense (e.g., true for three or more edges) return undefined.

var resizeStyle = require('resize-cursors');
 
console.log(resizeStyle({}));                            // => undefined
console.log(resizeStyle({ top:  true }));                // => "ns-resize"
console.log(resizeStyle({ left: true }));                // => "ew-resize"
console.log(resizeStyle({ bottom: true, right: true })); // => "nwse-resize"
 
console.log(resizeStyle({ top: true, bottom: true, left: true }));
// => undefined

Changelog

1.0.0

  • Initial release

License

MIT

install

npm i resize-cursors

Downloadsweekly downloads

0

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability