99import { css } from '@emotion/react' ;
1010
1111import { UseEuiTheme , transparentize } from '../../services' ;
12- import { logicalCSS , mathWithUnits } from '../../global_styling' ;
12+ import { logicalCSS , mathWithUnits , euiCanAnimate } from '../../global_styling' ;
1313
1414export const euiResizableButtonStyles = ( euiThemeContext : UseEuiTheme ) => {
1515 const { euiTheme } = euiThemeContext ;
@@ -38,17 +38,23 @@ export const euiResizableButtonStyles = (euiThemeContext: UseEuiTheme) => {
3838 ${ logicalCSS ( 'top' , '50%' ) }
3939 ${ logicalCSS ( 'left' , '50%' ) }
4040 background-color : ${ euiTheme . colors . darkestShade } ;
41- transition : width ${ transition } , height ${ transition } ,
42- transform ${ transition } , background-color ${ transition } ;
41+
42+ ${ euiCanAnimate } {
43+ transition : width ${ transition } , height ${ transition } ,
44+ transform ${ transition } , background-color ${ transition } ;
45+ }
4346 }
4447
4548 /* Lighten the "grab" icon on :hover */
4649 & : hover {
4750 & ::before ,
4851 & ::after {
4952 background-color : ${ euiTheme . colors . mediumShade } ;
53+
5054 /* Delay transition on hover so animation is not accidentally triggered on mouse over */
51- transition-delay : ${ transitionSpeed } ;
55+ ${ euiCanAnimate } {
56+ transition-delay : ${ transitionSpeed } ;
57+ }
5258 }
5359 }
5460
@@ -62,9 +68,11 @@ export const euiResizableButtonStyles = (euiThemeContext: UseEuiTheme) => {
6268 background-color : ${ euiTheme . colors . primary } ;
6369
6470 /* Overrides default transition so that "grab" icon background-color doesn't animate */
65- transition : width ${ transition } , height ${ transition } ,
66- transform ${ transition } ;
67- transition-delay : ${ mathWithUnits ( transitionSpeed , ( x ) => x / 2 ) } ;
71+ ${ euiCanAnimate } {
72+ transition : width ${ transition } , height ${ transition } ,
73+ transform ${ transition } ;
74+ transition-delay : ${ mathWithUnits ( transitionSpeed , ( x ) => x / 2 ) } ;
75+ }
6876 }
6977 }
7078 ` ,
0 commit comments