1
0
mirror of https://github.com/flarum/core.git synced 2025-07-25 18:51:40 +02:00

fix: groupmentions have poor contrast on some backgrounds (#3672)

* fix: poor text contrast on some backgrounds
* use hexdec()
* fix render test
* appears to be working now
This commit is contained in:
Ian Morland
2022-11-07 15:49:47 +00:00
committed by GitHub
parent eeb00cc56b
commit c98e6ba5a7
4 changed files with 66 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
import app from 'flarum/forum/app';
import username from 'flarum/common/helpers/username';
import extractText from 'flarum/common/utils/extractText';
import isDark from 'flarum/common/utils/isDark';
export function filterUserMentions(tag) {
let user;
@@ -40,6 +41,7 @@ export function filterGroupMentions(tag) {
tag.setAttribute('groupname', extractText(group.namePlural()));
tag.setAttribute('icon', group.icon());
tag.setAttribute('color', group.color());
tag.setAttribute('class', isDark(group.color()) ? 'GroupMention--light' : 'GroupMention--dark');
return true;
}