]> cat aescling's git repositories - mastodon.git/commitdiff
Make unfollow button light up red when hovered (#8286)
authorEugen Rochko <eugen@zeonfederated.com>
Sun, 19 Aug 2018 01:28:43 +0000 (03:28 +0200)
committerGitHub <noreply@github.com>
Sun, 19 Aug 2018 01:28:43 +0000 (03:28 +0200)
Fix #8284

app/helpers/stream_entries_helper.rb
app/javascript/styles/mastodon/components.scss
app/javascript/styles/mastodon/stream_entries.scss

index 121644263dc4a40edcc1f925ccca930cd7916d53..9ded69436b15261284360cd2396551cf3451fbb2 100644 (file)
@@ -19,7 +19,7 @@ module StreamEntriesHelper
           safe_join([render(file: Rails.root.join('app', 'javascript', 'images', 'logo.svg')), t('settings.edit_profile')])
         end
       elsif current_account.following?(account) || current_account.requested?(account)
-        link_to account_unfollow_path(account), class: 'button logo-button', data: { method: :post } do
+        link_to account_unfollow_path(account), class: 'button logo-button button--destructive', data: { method: :post } do
           safe_join([render(file: Rails.root.join('app', 'javascript', 'images', 'logo.svg')), t('accounts.unfollow')])
         end
       else
index cfd8e5ad484f7808a42a04f6830d6ac5d5e219e5..7c58828fd69ad34855000c64ffa5c2ab5d10d000 100644 (file)
     transition: all 200ms ease-out;
   }
 
+  &--destructive {
+    transition: none;
+
+    &:active,
+    &:focus,
+    &:hover {
+      background-color: $error-red;
+      transition: none;
+    }
+  }
+
   &:disabled {
     background-color: $ui-primary-color;
     cursor: default;
index 5aa809f76b90507239c8990ddf648d17b509fe35..14306c8bdf11f35072bc1b6a0c8f990c1a933bfb 100644 (file)
     }
   }
 
+  &.button--destructive {
+    &:active,
+    &:focus,
+    &:hover {
+      background: $error-red;
+
+      svg path:last-child {
+        fill: $error-red;
+      }
+    }
+  }
+
   @media screen and (max-width: $no-gap-breakpoint) {
     svg {
       display: none;