diff --git a/app/assets/stylesheets/buttons.css b/app/assets/stylesheets/buttons.css index 266f1034b..80023efa9 100644 --- a/app/assets/stylesheets/buttons.css +++ b/app/assets/stylesheets/buttons.css @@ -69,6 +69,7 @@ /* Circle buttons */ &.btn--circle, + &[aria-label]:where(:has(.icon)), &:where(:has(.for-screen-reader):has(.icon)) { --btn-border-radius: 50%; --btn-padding: 0; diff --git a/app/helpers/navigation_helper.rb b/app/helpers/navigation_helper.rb index d7c99ec86..d1bb85a81 100644 --- a/app/helpers/navigation_helper.rb +++ b/app/helpers/navigation_helper.rb @@ -6,4 +6,11 @@ module NavigationHelper icon_tag(icon) + tag.span(label, class: "for-screen-reader") end end + + def link_to_back(fallback_path: root_path) + link_to fallback_path, class: "btn flex-item-justify-start", aria: { label: "Go back" }, + data: { controller: "back-navigation hotkey", action: "keydown.esc@document->hotkey#click", back_navigation_fallback_destination_value: fallback_path } do + icon_tag("arrow-left") + end + end end diff --git a/app/views/bubbles/show.html.erb b/app/views/bubbles/show.html.erb index cdd73d38f..8d98ac80a 100644 --- a/app/views/bubbles/show.html.erb +++ b/app/views/bubbles/show.html.erb @@ -22,12 +22,8 @@