From 66c258355707e9bc6d66aebcf145fd735ae30a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 11 Aug 2022 02:35:06 +0200 Subject: [PATCH] Render icons using CSS in user permissions As mentioned in commit 925f04e3f, icon classes make screen readers announce strange symbols and aren't properly displayed for people who have changed their preferred font family. --- .../stylesheets/account/permissions_list.scss | 22 +++++++++++++------ .../permissions_list_component.html.erb | 8 +------ .../account/permissions_list_component.rb | 8 +++++++ .../permissions_list_component_spec.rb | 10 +++++++++ 4 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 spec/components/account/permissions_list_component_spec.rb diff --git a/app/assets/stylesheets/account/permissions_list.scss b/app/assets/stylesheets/account/permissions_list.scss index 2e476d6b0..fbd0a5043 100644 --- a/app/assets/stylesheets/account/permissions_list.scss +++ b/app/assets/stylesheets/account/permissions_list.scss @@ -7,17 +7,25 @@ font-size: $small-font-size; margin-bottom: $line-height / 2; - span { - color: $text-medium; - font-size: rem-calc(12); + &::before { + font-size: 0.9em; + margin-#{$global-right}: 0.2em; } - .icon-check { - color: $check; + &.permission-allowed { + @include has-fa-icon(check, solid); + + &::before { + color: $check; + } } - .icon-x { - color: $delete; + &.permission-denied { + @include has-fa-icon(times, solid); + + &::before { + color: $delete; + } } } } diff --git a/app/components/account/permissions_list_component.html.erb b/app/components/account/permissions_list_component.html.erb index 2d7c63687..055c9a922 100644 --- a/app/components/account/permissions_list_component.html.erb +++ b/app/components/account/permissions_list_component.html.erb @@ -1,12 +1,6 @@