Fix text color contrast on social previews (#19163)
This commit is contained in:
parent
bfe797f44d
commit
78bb52a627
1 changed files with 3 additions and 1 deletions
|
|
@ -1,5 +1,7 @@
|
|||
<% accent_color = Color::CompareHex.new([user_colors(@article.user)[:bg], user_colors(@article.user)[:text]]).biggest %>
|
||||
<% dark_color = Color::CompareHex.new([user_colors(@article.user)[:bg], user_colors(@article.user)[:text]]).brightness(0.8) %>
|
||||
<% dark_color = Color::CompareHex.new([user_colors(@article.user)[:bg], user_colors(@article.user)[:text]]).brightness(0.8). %>
|
||||
<% then { |color| Color::Accessibility.new(color).low_contrast? ? "black" : color } %>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background: <%= accent_color %>;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue