]> cat aescling's git repositories - mastodon.git/commitdiff
Change styling of account note editing buttons
authorThibaut Girka <thib@sitedethib.com>
Tue, 7 Jul 2020 17:26:08 +0000 (19:26 +0200)
committerThibG <thib@sitedethib.com>
Thu, 9 Jul 2020 10:19:43 +0000 (12:19 +0200)
Co-Authored-By: Mélanie Chauvel (ariasuni) <perso@hack-libre.org>
app/javascript/flavours/glitch/features/account/components/account_note.js
app/javascript/flavours/glitch/styles/components/accounts.scss

index 8a99bfcb86d7e1583a37db34eb8981138c708ff8..6e5ed7703a26094b5be6bd3a7b272b3308bcf573 100644 (file)
@@ -54,11 +54,11 @@ class Header extends ImmutablePureComponent {
     if (isEditing) {
       action_buttons = (
         <div className='account__header__account-note__buttons'>
-          <button className='text-btn' tabIndex='0' onClick={this.props.onCancelAccountNote} disabled={isSubmitting}>
+          <button className='icon-button' tabIndex='0' onClick={this.props.onCancelAccountNote} disabled={isSubmitting}>
             <Icon id='times' size={15} /> <FormattedMessage id='account_note.cancel' defaultMessage='Cancel' />
           </button>
           <div className='flex-spacer' />
-          <button className='text-btn' tabIndex='0' onClick={this.props.onSaveAccountNote} disabled={isSubmitting}>
+          <button className='icon-button' tabIndex='0' onClick={this.props.onSaveAccountNote} disabled={isSubmitting}>
             <Icon id='check' size={15} /> <FormattedMessage id='account_note.save' defaultMessage='Save' />
           </button>
         </div>
@@ -66,7 +66,7 @@ class Header extends ImmutablePureComponent {
     } else {
       action_buttons = (
         <div className='account__header__account-note__buttons'>
-          <button className='text-btn' tabIndex='0' onClick={this.props.onEditAccountNote} disabled={isSubmitting}>
+          <button className='icon-button' tabIndex='0' onClick={this.props.onEditAccountNote} disabled={isSubmitting}>
             <Icon id='pencil' size={15} /> <FormattedMessage id='account_note.edit' defaultMessage='Edit' />
           </button>
         </div>
index c1e3ae8357999752eaef79ee976cbf7376e66438..0fc2a11ffa2c9f4f5cb1cf1e5fb83c72f7016e4f 100644 (file)
       justify-content: flex-end;
       flex: 1 0;
 
+      .icon-button {
+        font-size: 14px;
+        padding: 2px 6px;
+        color: $darker-text-color;
+
+  &:hover,
+  &:active,
+  &:focus {
+    color: lighten($darker-text-color, 7%);
+    background-color: rgba($darker-text-color, 0.15);
+  }
+
+  &:focus {
+    background-color: rgba($darker-text-color, 0.3);
+  }
+
+  &[disabled] {
+    color: darken($darker-text-color, 13%);
+    background-color: transparent;
+    cursor: default;
+  }
+      }
+
       .flex-spacer {
-        flex: 0 0 15px;
+        flex: 0 0 5px;
         background: transparent;
       }
     }
       text-transform: uppercase;
     }
 
-    button:hover span {
-      text-decoration: underline;
-    }
-
     textarea {
       display: block;
       box-sizing: border-box;