aboutsummaryrefslogtreecommitdiff
path: root/src/components/favorite_button/favorite_button.vue
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2022-08-22 21:21:43 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2022-08-22 21:21:43 +0000
commit4e2feae8686c7ff7cbaec35d0c8e07f0a696c2dd (patch)
tree1729d9464fc49c6c4a8623bcfeade595b09e1e3b /src/components/favorite_button/favorite_button.vue
parent966dc36954dde7ec7f77f576b960f4874783db58 (diff)
parentcd536157ee0e675f7a2d408043c2ddbbc30eaa3b (diff)
Merge branch 'from/develop/tusooa/1092-accessible-status-xact' into 'develop'
Make status interaction buttons accessible Closes #1092 See merge request pleroma/pleroma-fe!1425
Diffstat (limited to 'src/components/favorite_button/favorite_button.vue')
-rw-r--r--src/components/favorite_button/favorite_button.vue51
1 files changed, 46 insertions, 5 deletions
diff --git a/src/components/favorite_button/favorite_button.vue b/src/components/favorite_button/favorite_button.vue
index d5c4c61e..74a1dfbb 100644
--- a/src/components/favorite_button/favorite_button.vue
+++ b/src/components/favorite_button/favorite_button.vue
@@ -7,11 +7,31 @@
:title="$t('tool_tip.favorite')"
@click.prevent="favorite()"
>
- <FAIcon
- class="fa-scale-110 fa-old-padding"
- :icon="[status.favorited ? 'fas' : 'far', 'star']"
- :spin="animated"
- />
+ <FALayers class="fa-scale-110 fa-old-padding-layer">
+ <FAIcon
+ class="fa-scale-110"
+ :icon="[status.favorited ? 'fas' : 'far', 'star']"
+ :spin="animated"
+ />
+ <FAIcon
+ v-if="status.favorited"
+ class="active-marker"
+ transform="shrink-6 up-9 right-12"
+ icon="check"
+ />
+ <FAIcon
+ v-if="!status.favorited"
+ class="focus-marker"
+ transform="shrink-6 up-9 right-12"
+ icon="plus"
+ />
+ <FAIcon
+ v-else
+ class="focus-marker"
+ transform="shrink-6 up-9 right-12"
+ icon="minus"
+ />
+ </FALayers>
</button>
<span v-else>
<FAIcon
@@ -33,6 +53,7 @@
<style lang="scss">
@import '../../_variables.scss';
+@import '../../_mixins.scss';
.FavoriteButton {
display: flex;
@@ -57,6 +78,26 @@
color: $fallback--cOrange;
color: var(--cOrange, $fallback--cOrange);
}
+
+ @include unfocused-style {
+ .focus-marker {
+ visibility: hidden;
+ }
+
+ .active-marker {
+ visibility: visible;
+ }
+ }
+
+ @include focused-style {
+ .focus-marker {
+ visibility: visible;
+ }
+
+ .active-marker {
+ visibility: hidden;
+ }
+ }
}
}
</style>