From f248d95be26ceca3c2d717fa71557a56e975fece Mon Sep 17 00:00:00 2001 From: Jeong Arm Date: Tue, 19 Jul 2022 08:06:11 +0900 Subject: [PATCH] Fix badge color not affected (#18826) * Fix badge color not affected * Generate user role css --- app/javascript/styles/mastodon/accounts.scss | 6 +++--- app/views/custom_css/show.css.erb | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/javascript/styles/mastodon/accounts.scss b/app/javascript/styles/mastodon/accounts.scss index 215774a19..54b65bfc8 100644 --- a/app/javascript/styles/mastodon/accounts.scss +++ b/app/javascript/styles/mastodon/accounts.scss @@ -210,9 +210,9 @@ font-size: 12px; line-height: 12px; font-weight: 500; - color: $ui-secondary-color; - background-color: rgba($ui-secondary-color, 0.1); - border: 1px solid rgba($ui-secondary-color, 0.5); + color: var(--user-role-accent, $ui-secondary-color); + background-color: var(--user-role-background, rgba($ui-secondary-color, 0.1)); + border: 1px solid var(--user-role-border, rgba($ui-secondary-color, 0.5)); &.moderator { color: $success-green; diff --git a/app/views/custom_css/show.css.erb b/app/views/custom_css/show.css.erb index 9cd38fb37..bcbe81962 100644 --- a/app/views/custom_css/show.css.erb +++ b/app/views/custom_css/show.css.erb @@ -5,6 +5,8 @@ <%- UserRole.where(highlighted: true).select { |role| role.color.present? }.each do |role| %> .user-role-<%= role.id %> { --user-role-accent: <%= role.color %>; + --user-role-background: <%= role.color + '19' %>; + --user-role-border: <%= role.color + '80' %>; } <%- end %>