kubetail-org / sentineljs

Detect new DOM nodes using CSS selectors (650 bytes)
MIT License
1.13k stars 51 forks source link

extraAnimation? #5

Closed crazy4groovy closed 6 years ago

crazy4groovy commented 6 years ago

Can you please explain extraAnimation a little bit more? I'm scratching my head about it..

amorey commented 6 years ago

SentinelJS uses CSS @keyframes and the animation-name property to detect when a new node matching the given CSS rule gets added to the DOM. If the CSS animation-name property is defined elsewhere then this can cause a conflict since only one of the animations will get triggered. The extraAnimation option adds an extra animation-name to SentinelJS's CSS definitions so that multiple animation events will get triggered when the node gets added to the DOM: https://github.com/muicss/sentineljs/blob/master/src/sentinel.js#L64

amorey commented 6 years ago

I added some details about this to the README: https://github.com/muicss/sentineljs/blob/master/README.md#introduction

I'm going to march this Issue as "archived" so others can see it later.

amorey commented 6 years ago

@crazy4groovy I removed extraAnimations in favor of new way to trigger SentinelJS watch functions from CSS. Here are some details on why this feature is useful: https://github.com/muicss/sentineljs/issues/4