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:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user