You've already forked joplin
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:
@@ -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'
|
||||||
/>;
|
/>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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');
|
||||||
|
|||||||
@@ -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';
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user