Skip to content

Commit 95aa6f0

Browse files
committed
[a11y] Add preferred motion/animation media queries
1 parent 8f60a62 commit 95aa6f0

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

src/components/table/table_row.styles.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
import { css, keyframes } from '@emotion/react';
1010

1111
import { UseEuiTheme, tint, shade, transparentize } from '../../services';
12-
import { euiBackgroundColor, logicalCSS } from '../../global_styling';
12+
import {
13+
euiCanAnimate,
14+
euiBackgroundColor,
15+
logicalCSS,
16+
} from '../../global_styling';
1317
import { euiShadow } from '../../themes/amsterdam/global_styling/mixins';
1418

1519
import { euiTableVariables } from './table.styles';
@@ -146,9 +150,11 @@ const _expandedRowAnimation = ({ euiTheme }: UseEuiTheme) => {
146150

147151
// Animation must be on the contents div inside, not the row itself
148152
return css`
149-
.euiTableCellContent {
150-
animation: ${euiTheme.animation.fast} ${euiTheme.animation.resistance} 1
151-
normal none ${expandRow};
153+
${euiCanAnimate} {
154+
.euiTableCellContent {
155+
animation: ${euiTheme.animation.fast} ${euiTheme.animation.resistance} 1
156+
normal none ${expandRow};
157+
}
152158
}
153159
`;
154160
};

src/components/table/table_row_cell.styles.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
import { css } from '@emotion/react';
1010

1111
import { UseEuiTheme } from '../../services';
12-
import { euiFontSize, euiTextTruncate, logicalCSS } from '../../global_styling';
12+
import {
13+
euiCanAnimate,
14+
euiFontSize,
15+
euiTextTruncate,
16+
logicalCSS,
17+
} from '../../global_styling';
1318

1419
import { euiTableVariables } from './table.styles';
1520

@@ -58,8 +63,11 @@ export const euiTableRowCellStyles = (euiThemeContext: UseEuiTheme) => {
5863
actions: css`
5964
.euiBasicTableAction-showOnHover {
6065
opacity: 0;
61-
transition: opacity ${euiTheme.animation.normal}
62-
${euiTheme.animation.resistance};
66+
67+
${euiCanAnimate} {
68+
transition: opacity ${euiTheme.animation.normal}
69+
${euiTheme.animation.resistance};
70+
}
6371
}
6472
6573
&:focus-within,

0 commit comments

Comments
 (0)