Skip to content

Commit

Permalink
Merge pull request #2149 from headlamp-k8s/reduced-motion-fix
Browse files Browse the repository at this point in the history
frontend: Fix reduced motion styles
  • Loading branch information
illume authored Jul 9, 2024
2 parents 320f2e2 + 2945374 commit 840701a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
15 changes: 15 additions & 0 deletions frontend/src/components/App/AppContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { GlobalStyles } from '@mui/material';
import { SnackbarProvider } from 'notistack';
import React from 'react';
import { BrowserRouter, HashRouter } from 'react-router-dom';
Expand All @@ -22,6 +23,20 @@ export default function AppContainer() {
horizontal: 'left',
}}
>
<GlobalStyles
styles={{
':root': {
'@media (prefers-reduced-motion: reduce)': {
'& *': {
animationDuration: '0.01ms !important',
animationIterationCount: '1 !important',
transitionDuration: '0.01ms !important',
scrollBehavior: 'auto !important',
},
},
},
}}
/>
<Router>
<PreviousRouteProvider>
<Plugins />
Expand Down
14 changes: 0 additions & 14 deletions frontend/src/lib/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,6 @@ const commonRules = {
borderRadius: 4,
},
components: {
MuiCssBaseline: {
styleOverrides: {
'@global': {
'@media (prefers-reduced-motion: reduce)': {
'*': {
animationDuration: '0.01ms !important',
animationIterationCount: '1 !important',
transitionDuration: '0.01ms !important',
scrollBehavior: 'auto !important',
},
},
},
},
},
MuiSelect: {
defaultProps: {
variant: 'standard' as 'filled' | 'outlined' | 'standard',
Expand Down

0 comments on commit 840701a

Please sign in to comment.