mirror of
https://github.com/flarum/core.git
synced 2025-08-14 20:34:10 +02:00
fix: DiscussionHero contrast
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { extend } from 'flarum/common/extend';
|
||||
import DiscussionListItem from 'flarum/forum/components/DiscussionListItem';
|
||||
import DiscussionHero from 'flarum/forum/components/DiscussionHero';
|
||||
import isDark from 'flarum/common/utils/isDark';
|
||||
|
||||
import tagsLabel from '../common/helpers/tagsLabel';
|
||||
import sortTags from '../common/utils/sortTags';
|
||||
@@ -23,7 +24,13 @@ export default function () {
|
||||
const color = tags[0].color();
|
||||
if (color) {
|
||||
view.attrs.style = { '--hero-bg': color };
|
||||
view.attrs.className += ' DiscussionHero--colored';
|
||||
|
||||
if (isDark(color)) {
|
||||
view.attrs.className += ' DiscussionHero--dark';
|
||||
}
|
||||
else {
|
||||
view.attrs.className += ' DiscussionHero--light';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@@ -42,13 +42,25 @@
|
||||
&.colored {
|
||||
--tag-color: var(--tag-bg);
|
||||
margin-right: 5px;
|
||||
background: @body-bg !important;
|
||||
}
|
||||
&.tag-light {
|
||||
background: @text-on-light !important;
|
||||
}
|
||||
&.tag-dark {
|
||||
background: @text-on-dark !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.DiscussionHero--colored {
|
||||
&, a {
|
||||
color: @body-bg;
|
||||
.DiscussionHero {
|
||||
&--light {
|
||||
&, a {
|
||||
color: @text-on-light;
|
||||
}
|
||||
}
|
||||
&--dark {
|
||||
&, a {
|
||||
color: @text-on-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
.TagsLabel {
|
||||
|
Reference in New Issue
Block a user