Skip to content

Commit

Permalink
πŸ›(frontend) fix broken animation when motion is reduced
Browse files Browse the repository at this point in the history
Feedback from one of our users.
I forgot animation can be disabled for accessibility purpose.
Fix it by bypassing the animation if reduce motion is activated.
Oopsie, mybad, I learnt something.
  • Loading branch information
lebaudantoine committed Dec 3, 2024
1 parent 4eea4d0 commit 05b7436
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/frontend/src/features/home/routes/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ const Columns = ({ children }: { children?: ReactNode }) => {
justifyContent: 'normal',
padding: '0 1rem',
width: 'calc(100% - 2rem)',
opacity: 0,
animation: '.5s ease-in fade 0s forwards',
'@media(prefers-reduced-motion: reduce)': {
opacity: 1,
},
'@media(prefers-reduced-motion: no-preference)': {
opacity: 0,
animation: '.5s ease-in fade 0s forwards',
},
lg: {
flexDirection: 'row',
justifyContent: 'center',
Expand Down

0 comments on commit 05b7436

Please sign in to comment.