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

Package Sidebar

Install

npm i create-hover-class

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • chinedufn