Background animejs

Viewed 272
  1. so i've been reading animejs documentation and found there that we can anime any css, so why it's "backgroundColor: '#FFF'" not "background-color: '#FFF' like css normal format?

  2. how to know what name properties which animejs know? in the documentation for example they accept backgroundColor but not background-color, but there no other properties listed, so i don't know for example is it font-size or fontSize that animejs can read

  3. there 2 ways listed in documentation on how to change color, backgroundColor and background, what is the difference?

1 Answers
  1. It uses something called the DOM style object, which is Javascript's way of referencing to a node's styles. This objects has properties, which reference the individual types of CSS styles.
  2. Have a look at https://www.w3schools.com/jsref/dom_obj_style.asp for a list of the style object's properties, the rule of thumb for converting is swap it from kebab-case to camelCase
  3. background provides a way to set all the background properties in one declaration, whereas backgroundColor only allows you to set the background colour
Related