From 59a50e6489c75d05d453683fe21cf7bb6d4e285f Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sat, 23 Dec 2017 19:48:31 -0800 Subject: [PATCH] Reduce motion for boost animation (#5871) * Reduce motion for boost animation Fixes #5833 * Fix ternary expression --- app/javascript/styles/mastodon/components.scss | 15 +++++++++++++-- app/views/layouts/application.html.haml | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 12919e7e88..63664d6074 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -2149,7 +2149,8 @@ @import 'boost'; -button.icon-button i.fa-retweet { +.no-reduce-motion button.icon-button i.fa-retweet { + background-position: 0 0; height: 19px; transition: background-position 0.9s steps(10); @@ -2160,13 +2161,23 @@ button.icon-button i.fa-retweet { &::before { display: none !important; } + } -button.icon-button.active i.fa-retweet { +.no-reduce-motion button.icon-button.active i.fa-retweet { transition-duration: 0.9s; background-position: 0 100%; } +.reduce-motion button.icon-button i.fa-retweet { + color: $ui-base-lighter-color; + transition: color 100ms ease-in; +} + +.reduce-motion button.icon-button.active i.fa-retweet { + color: $ui-highlight-color; +} + .status-card { display: flex; cursor: pointer; diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index ee995c987e..c0e01da30f 100755 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -28,6 +28,7 @@ - body_classes ||= @body_classes || '' - body_classes += ' system-font' if current_account&.user&.setting_system_font_ui + - body_classes += current_account&.user&.setting_reduce_motion ? ' reduce-motion' : ' no-reduce-motion' %body{ class: add_rtl_body_class(body_classes) } = content_for?(:content) ? yield(:content) : yield