npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

create-hover-class

1.0.0 • Public • Published

create-hover-class npm version Build Status

Create css hover class

TODO: Why use this?

To Install

$ npm install --save create-hover-class

Usage

var createHC = require('create-hover-class')
 
var hoverObject = createHC({
  color: 'rgba(0, 0, 0, 1)'
  'font-weight': '700'
})
 
console.log(hoverObject)
// {name: 'cih3lymsf0000wly8uizhbo6d', css: '.cih3lymsf0000wly8uizhbo6d:hover {...}'}

Using insert-css

var createHC = require('create-hover-class')
var insertCSS = require('insert-css')
var h = require('virtual-dom/h')
 
var hoverObj = createHC({/* keyframe object */})
insertCSS(HoverObj.css)
 
h('label', {
  className: hoverObj.name
}, 'I get big and red when you hover over me!')

API

createHC(hoverObject[, identifier]) -> object

hoverObject

Required
Type: object

Styles to apply on hover

identifier

Type: string

A class-name. create-hover-class will generate a cuid if no class-name is specified

See Also

License

MIT

install

npm i create-hover-class

Downloadsweekly downloads

19

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability