1
0
mirror of https://github.com/flarum/core.git synced 2025-08-11 10:55:47 +02:00

chore: improve group mentions parsing (#3723)

* chore: improve group mentions color handling
* Avoid storing the `GroupMention--dark` and light classes on the database.
* Avoid recreating YIQ logic on the backend.
* Improve text color flexibility through CSS variables.
* Apply fixes from StyleCI
* chore: tweak tests
* chre: unused import

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
Sami Mazouz
2023-01-22 14:11:13 +01:00
committed by GitHub
parent da1bf8da21
commit bf52743510
5 changed files with 45 additions and 69 deletions

View File

@@ -1,17 +1,17 @@
.PostMention, .UserMention, .GroupMention {
background: @control-bg;
color: @control-color;
background: var(--control-bg);
color: var(--control-color);
border-radius: @border-radius;
padding: 2px 5px;
border: 0 !important;
font-weight: 600;
blockquote & {
background: @body-bg;
background: var(--body-bg);
}
&:hover,
&:active {
color: @link-color;
color: var(--link-color);
}
}
.UserMention, .PostMention, .GroupMention {
@@ -98,35 +98,13 @@
.Button--color(@tooltip-color, @tooltip-bg);
}
.GroupMention {
& when (@config-dark-mode = false) {
&,
&:hover,
&:active {
color: @text-on-light;
}
}
& when (@config-dark-mode = true) {
&,
&:hover,
&:active {
color: @text-on-dark;
}
}
background-color: var(--group-color, var(--control-bg));
color: var(--control-color);
--link-color: currentColor;
&--light {
&,
&:hover,
&:active {
color: @text-on-light;
}
}
&--dark {
&,
&:hover,
&:active {
color: @text-on-dark;
}
&--colored {
--control-color: var(--contrast-color, var(--body-bg));
--link-color: var(--control-color);
}
.icon {