packages/js-toolkit/utils/css/transition.js
/**
 * Test if the given element has a transition duration.
 *
 * @param  {HTMLElement} element The element to test.
 * @return {Boolean}             The result of the test.
 */
Test if the given element has a transition duration.
@param  {HTMLElement} element The element to test.
@return {Boolean}             The result of the test.
Test if the given element has a transition duration . @param { HTMLElement } element The element to test . @return { Boolean } The result of the test .
function testTransition(element) {
  if (typeof window === 'undefined') {
    return false;
  }
  const { transitionDuration } = window.getComputedStyle(element);
  return !!transitionDuration && transitionDuration !== '0s';
}
function testTransition ( element ) { if ( typeof window === 'undefined' ) { return false ; } const { transitionDuration } = window . getComputedStyle ( element ) ; return ! ! transitionDuration && transitionDuration !== '0s' ; }
Test if the given element has a transition duration.
Test if the given element has a transition duration .