1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

Desktop: Accessibility: Disable sync icon animation when reduce motion is enabled (#13283)

This commit is contained in:
Henry Heino
2025-09-24 03:12:38 -07:00
committed by GitHub
parent 1ef8fd529b
commit 8b8b6fbe36
5 changed files with 20 additions and 10 deletions

View File

@@ -225,7 +225,7 @@ const Button = React.forwardRef(({
animation={iconAnimation} animation={iconAnimation}
mr={iconOnly ? '0' : '6px'} mr={iconOnly ? '0' : '6px'}
color={color} color={color}
className={iconName} className={`${iconName} icon`}
role='img' role='img'
/>; />;
} }

View File

@@ -25,14 +25,13 @@ interface Props {
const SidebarComponent = (props: Props) => { const SidebarComponent = (props: Props) => {
const renderSynchronizeButton = (type: string) => { const renderSynchronizeButton = (type: string) => {
const label = type === 'sync' ? _('Synchronise') : _('Cancel'); const label = type === 'sync' ? _('Synchronise') : _('Cancel');
const iconAnimation = type !== 'sync' ? 'icon-infinite-rotation 1s linear infinite' : '';
return ( return (
<StyledSynchronizeButton <StyledSynchronizeButton
level={ButtonLevel.SidebarSecondary} level={ButtonLevel.SidebarSecondary}
className={`sidebar-sync-button ${type === 'sync' ? '' : '-syncing'}`}
iconName="icon-sync" iconName="icon-sync"
key="sync_button" key="sync_button"
iconAnimation={iconAnimation}
title={label} title={label}
onClick={() => { onClick={() => {
void CommandService.instance().execute('synchronize', type !== 'sync'); void CommandService.instance().execute('synchronize', type !== 'sync');

View File

@@ -5,4 +5,5 @@
@use 'styles/sidebar-expand-link.scss'; @use 'styles/sidebar-expand-link.scss';
@use 'styles/sidebar-header-container.scss'; @use 'styles/sidebar-header-container.scss';
@use 'styles/sidebar-spacer-item.scss'; @use 'styles/sidebar-spacer-item.scss';
@use 'styles/sidebar-header-button.scss'; @use 'styles/sidebar-header-button.scss';
@use 'styles/sidebar-sync-button.scss';

View File

@@ -0,0 +1,16 @@
@keyframes icon-infinite-rotation {
to {
transform: rotate(360deg);
}
}
.sidebar-sync-button {
&.-syncing > .icon {
animation: icon-infinite-rotation 1s linear infinite;
@media (prefers-reduced-motion: reduce) {
animation: none;
}
}
}

View File

@@ -97,12 +97,6 @@ a {
border-radius: 5px; border-radius: 5px;
} }
@keyframes icon-infinite-rotation{
to {
transform: rotate(360deg);
}
}
.rdtPicker { .rdtPicker {
min-width: 250px; min-width: 250px;
width: auto !important; width: auto !important;