npm

Does your artifact manager get in the way? Join us on Oct. 8 at 10am PT, to discuss how npm can help.Sign up »

cssobj-plugin-keyframes

1.0.4 • Public • Published

cssobj-plugin-keyframes

Make keyframes rules localized, and apply to animation and animation-name css props.

CircleCI

Install

npm install cssobj-plugin-keyframes

Usage

var lib = require('cssobj-plugin-keyframes')
var obj = {
  '@keyframes abc': {},
  '@keyframes !def': {},  // adding ! to become `global` space
  p: {animation: '1s abc'}
  div: {animationName: '!def'}  // adding ! to become `global` space
}
 
cssobj(obj, { plugins: [lib()] })

result css:

@keyframes abc_ani_i3bhs8s1_ {}
@keyframes def {}
p {
  animation: 1s abc_ani_i3bhs8s1_;
}
div {
  animation-name: def;
}

Caveat

  • animation-name prop should at last position in animation shorthand, that simplified the parser, and more unified.

install

npm i cssobj-plugin-keyframes

Downloadsweekly downloads

3

version

1.0.4

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability