optimized and prettified status action buttons
This commit is contained in:
parent
34a7bf83b2
commit
a5d71023f6
4 changed files with 51 additions and 30 deletions
|
|
@ -6,19 +6,24 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 1.5em;
|
border: 2px solid transparent;
|
||||||
|
|
||||||
|
.chevron-popover {
|
||||||
|
.popover-trigger-button {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.action-counter {
|
.action-counter {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
margin-left: 1em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-button-inner,
|
.action-button-inner,
|
||||||
.extra-button {
|
.extra-button {
|
||||||
margin: -0.5em;
|
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.separator {
|
.separator {
|
||||||
|
|
@ -26,27 +31,12 @@
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
width: 1px;
|
width: 1px;
|
||||||
background-color: var(--icon);
|
background-color: var(--icon);
|
||||||
margin-left: 0.75em;
|
margin: 0.5em 0;
|
||||||
margin-right: 0.125em;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.-pin {
|
|
||||||
margin: calc(-2px - 0.25em);
|
|
||||||
padding: 0.25em;
|
|
||||||
border: 2px dashed var(--icon);
|
|
||||||
border-radius: var(--roundness);
|
|
||||||
grid-template-columns: minmax(max-content, 1fr) auto;
|
|
||||||
|
|
||||||
.chevron-icon,
|
|
||||||
.extra-button,
|
|
||||||
.separator {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-button-inner {
|
.action-button-inner {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-gap: 1em;
|
grid-gap: 0.125em;
|
||||||
grid-template-columns: max-content;
|
grid-template-columns: max-content;
|
||||||
grid-auto-flow: column;
|
grid-auto-flow: column;
|
||||||
grid-auto-columns: max-content;
|
grid-auto-columns: max-content;
|
||||||
|
|
@ -72,6 +62,32 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.-pin {
|
||||||
|
border: 2px dashed var(--icon);
|
||||||
|
border-radius: var(--roundness);
|
||||||
|
grid-template-columns: minmax(max-content, 1fr) auto;
|
||||||
|
|
||||||
|
.action-button-inner {
|
||||||
|
opacity: 0.8;
|
||||||
|
padding-right: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chevron-icon,
|
||||||
|
.extra-button,
|
||||||
|
.separator {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.-with-extra {
|
||||||
|
.action-button-inner,
|
||||||
|
.extra-button {
|
||||||
|
padding-left: 0.2em;
|
||||||
|
padding-right: 0.25em;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-button {
|
.action-button {
|
||||||
|
|
@ -106,7 +122,7 @@
|
||||||
&.-extra {
|
&.-extra {
|
||||||
.action-counter {
|
.action-counter {
|
||||||
justify-self: end;
|
justify-self: end;
|
||||||
margin-right: 1em;
|
margin-left: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chevron-icon {
|
.chevron-icon {
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,6 @@
|
||||||
<FAIcon
|
<FAIcon
|
||||||
v-if="button.dropdown?.()"
|
v-if="button.dropdown?.()"
|
||||||
class="chevron-icon"
|
class="chevron-icon"
|
||||||
size="lg"
|
|
||||||
:icon="extra ? 'chevron-right' : 'chevron-up'"
|
:icon="extra ? 'chevron-right' : 'chevron-up'"
|
||||||
fixed-width
|
fixed-width
|
||||||
/>
|
/>
|
||||||
|
|
@ -71,6 +70,7 @@
|
||||||
/>
|
/>
|
||||||
<Popover
|
<Popover
|
||||||
v-if="button.name === 'bookmark'"
|
v-if="button.name === 'bookmark'"
|
||||||
|
class="chevron-popover"
|
||||||
:trigger="extra ? 'hover' : 'click'"
|
:trigger="extra ? 'hover' : 'click'"
|
||||||
:placement="extra ? 'right' : 'top'"
|
:placement="extra ? 'right' : 'top'"
|
||||||
:offset="extra ? { x: 10 } : { y: 10 }"
|
:offset="extra ? { x: 10 } : { y: 10 }"
|
||||||
|
|
@ -79,7 +79,6 @@
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<FAIcon
|
<FAIcon
|
||||||
class="chevron-icon"
|
class="chevron-icon"
|
||||||
size="lg"
|
|
||||||
:icon="extra ? 'chevron-right' : 'chevron-up'"
|
:icon="extra ? 'chevron-right' : 'chevron-up'"
|
||||||
fixed-width
|
fixed-width
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,19 @@
|
||||||
.StatusActionButtons {
|
.StatusActionButtons {
|
||||||
.quick-action-buttons {
|
.quick-action-buttons {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(10%, 3em));
|
margin-left: -0.5em;
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(3.5em, 10%));
|
||||||
grid-auto-flow: row dense;
|
grid-auto-flow: row dense;
|
||||||
grid-auto-rows: 1fr;
|
grid-auto-rows: 1fr;
|
||||||
grid-gap: 1.25em 0;
|
grid-gap: 0.5em 0.1em;
|
||||||
margin-top: var(--status-margin);
|
margin-top: var(--status-margin);
|
||||||
}
|
}
|
||||||
|
|
||||||
.pin-action-button {
|
.pin-action-button {
|
||||||
margin: -0.5em;
|
display: flex;
|
||||||
|
z-index: 1;
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// popover
|
// popover
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="StatusActionButtons">
|
<div class="StatusActionButtons">
|
||||||
<span class="quick-action-buttons">
|
<span
|
||||||
|
class="quick-action-buttons"
|
||||||
|
:class="{ '-pin': showPin }"
|
||||||
|
>
|
||||||
<span
|
<span
|
||||||
v-for="button in quickButtons"
|
v-for="button in quickButtons"
|
||||||
:key="button.name"
|
:key="button.name"
|
||||||
class="quick-action"
|
class="quick-action"
|
||||||
:class="{ '-pin': showPin, '-toggle': button.dropdown?.() }"
|
:class="{ '-pin': showPin, '-toggle': button.dropdown?.(), '-with-extra': button.name === 'bookmark' }"
|
||||||
>
|
>
|
||||||
<ActionButtonContainer
|
<ActionButtonContainer
|
||||||
:class="{ '-pin': showPin }"
|
:class="{ '-pin': showPin }"
|
||||||
|
|
@ -30,7 +33,6 @@
|
||||||
<FAIcon
|
<FAIcon
|
||||||
v-if="showPin && currentUser"
|
v-if="showPin && currentUser"
|
||||||
fixed-width
|
fixed-width
|
||||||
class="fa-scale-110"
|
|
||||||
icon="thumbtack"
|
icon="thumbtack"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -38,6 +40,7 @@
|
||||||
<Popover
|
<Popover
|
||||||
trigger="click"
|
trigger="click"
|
||||||
:trigger-attrs="triggerAttrs"
|
:trigger-attrs="triggerAttrs"
|
||||||
|
class="quick-action"
|
||||||
:tabindex="0"
|
:tabindex="0"
|
||||||
placement="top"
|
placement="top"
|
||||||
:offset="{ y: 5 }"
|
:offset="{ y: 5 }"
|
||||||
|
|
@ -46,7 +49,7 @@
|
||||||
>
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<FAIcon
|
<FAIcon
|
||||||
class="fa-scale-110 "
|
class="action-button-inner"
|
||||||
icon="ellipsis-h"
|
icon="ellipsis-h"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue