From 122935e723b1864fa2f7d7d38195ca573ade0ee8 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 10 Jan 2023 16:05:50 +0100 Subject: [PATCH] only show formatting help on focus/hover in inbox entries --- .../stylesheets/components/_inbox-entry.scss | 15 +++++++++++++++ app/views/inbox/_entry.html.haml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/components/_inbox-entry.scss b/app/assets/stylesheets/components/_inbox-entry.scss index 38cdf4ba..efbe739b 100644 --- a/app/assets/stylesheets/components/_inbox-entry.scss +++ b/app/assets/stylesheets/components/_inbox-entry.scss @@ -1,4 +1,6 @@ .inbox-entry { + $this: &; + &--new { box-shadow: 0 0.125rem 0.25rem var(--primary); @@ -19,4 +21,17 @@ } } } + + .format-help { + opacity: .3; + + #{$this}:focus-within & { + opacity: 1; + } + } + + &:focus-within .format-help, + &:hover .format-help { + opacity: 1; + } } diff --git a/app/views/inbox/_entry.html.haml b/app/views/inbox/_entry.html.haml index 2971eba2..bab43c53 100644 --- a/app/views/inbox/_entry.html.haml +++ b/app/views/inbox/_entry.html.haml @@ -32,7 +32,7 @@ %button.btn.btn-default.px-1{ name: "ib-options", data: { ib_id: i.id, state: :hidden } } %i.fa.fa-chevron-down %span.pe-none= t(".options") - %p.ms-auto.align-self-center.mt-2.mt-sm-0.text-center + %p.format-help.ms-auto.align-self-center.mt-2.mt-sm-0.text-center = render "shared/format_link" .card-footer.d-none{ id: "ib-options-#{i.id}" } %h4= t(".sharing.heading")