From 69394051733780924287d4d4f651d337ca427b29 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 14 Jan 2025 19:43:47 +0200 Subject: [PATCH] cleanup + brought back quick actions styles --- .../status_action_buttons/action_button.js | 21 +++++-- .../status_action_buttons/action_button.scss | 62 +++++++++++++------ .../status_action_buttons/action_button.vue | 10 +-- .../action_button_container.vue | 4 +- .../status_action_buttons.scss | 11 ++-- .../status_action_buttons.vue | 3 +- 6 files changed, 72 insertions(+), 39 deletions(-) diff --git a/src/components/status_action_buttons/action_button.js b/src/components/status_action_buttons/action_button.js index 27a894015..df4d95ca2 100644 --- a/src/components/status_action_buttons/action_button.js +++ b/src/components/status_action_buttons/action_button.js @@ -9,12 +9,14 @@ import { faTimes, faWrench, + faChevronRight, + faChevronUp, + faReply, faRetweet, faStar, faSmileBeam, - faEllipsisH, faBookmark, faEyeSlash, faThumbtack, @@ -33,13 +35,15 @@ library.add( faTimes, faWrench, + faChevronRight, + faChevronUp, + faReply, faRetweet, faStar, faStarRegular, faSmileBeam, - faEllipsisH, faBookmark, faEyeSlash, faThumbtack, @@ -67,14 +71,23 @@ export default { }, computed: { buttonClass () { + if (!this.extra) console.log(this.button.name) + return [ + this.button.name + '-button', + { + '-with-extra': this.button.name === 'bookmark', + '-extra': this.extra, + '-quick': !this.extra + } + ] + }, + buttonInnerClass () { if (!this.extra) console.log(this.button.name) return [ this.button.name + '-button', { 'main-button': this.extra, 'button-unstyled': !this.extra, - '-extra': this.extra, - '-quick': !this.extra, '-active': this.button.active?.(this.funcArg), disabled: this.button.interactive ? !this.button.interactive(this.funcArg) : false } diff --git a/src/components/status_action_buttons/action_button.scss b/src/components/status_action_buttons/action_button.scss index 4827c9c8e..f269a3b7c 100644 --- a/src/components/status_action_buttons/action_button.scss +++ b/src/components/status_action_buttons/action_button.scss @@ -1,41 +1,63 @@ @import "../../mixins"; /* stylelint-disable declaration-no-important */ -.action-button { +.quick-action { display: grid; + grid-template-columns: max-content; + grid-gap: 0.25em; - &.-with-extra { - grid-template-columns: 1fr calc(var(--__line-height) + 2 * var(--__horizontal-gap)); + &.-pin { + margin: calc(-2px - 0.25em); + padding: 0.25em; + border: 2px dashed var(--icon); + border-radius: var(--roundness); + grid-template-columns: 1fr auto; } - &.-quick { + .action-button-inner, + .extra-button { + margin: -0.5em; + padding: 0.5em; + } + + .action-button-inner { display: grid; - grid-template-columns: max-content auto; grid-gap: 1em; + grid-template-columns: max-content max-content; + grid-auto-flow: column; + grid-auto-columns: max-content; align-items: center; } - &.disabled { - cursor: not-allowed; + .extra-button { + border-left: 1px solid var(--icon); } +} - &:hover, - &.-active { - &.reply-button:not(.disabled) { - .svg-inline--fa { - color: var(--cBlue); +.action-button { + display: grid; + grid-auto-flow: column; + padding: 0; + + .action-button-inner { + &:hover, + &.-active { + &.reply-button:not(.disabled) { + .svg-inline--fa { + color: var(--cBlue); + } } - } - &.retweet-button:not(.disabled) { - .svg-inline--fa { - color: var(--cGreen); + &.retweet-button:not(.disabled) { + .svg-inline--fa { + color: var(--cGreen); + } } - } - &.favorite-button:not(.disabled) { - .svg-inline--fa { - color: var(--cOrange); + &.favorite-button:not(.disabled) { + .svg-inline--fa { + color: var(--cOrange); + } } } } diff --git a/src/components/status_action_buttons/action_button.vue b/src/components/status_action_buttons/action_button.vue index 50dce14bd..9e645bc2a 100644 --- a/src/components/status_action_buttons/action_button.vue +++ b/src/components/status_action_buttons/action_button.vue @@ -1,12 +1,12 @@ diff --git a/src/components/status_action_buttons/action_button_container.vue b/src/components/status_action_buttons/action_button_container.vue index 6363b2b2d..91324b5ba 100644 --- a/src/components/status_action_buttons/action_button_container.vue +++ b/src/components/status_action_buttons/action_button_container.vue @@ -1,14 +1,14 @@