Skip to content
Snippets Groups Projects
Commit b57422a8 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

recolor icons via css, fixes #2629

Closes #2629

Merge request studip/studip!1780
parent 14bba287
Branches
No related tags found
No related merge requests found
...@@ -230,14 +230,12 @@ class ResponsiveHelper ...@@ -230,14 +230,12 @@ class ResponsiveHelper
} }
$avatar = $avatarClass::getAvatar($course->id); $avatar = $avatarClass::getAvatar($course->id);
if ($avatar->is_customized()) { $hasAvatar = $avatar->is_customized();
$icon = $avatar->getURL(Avatar::SMALL); $icon = $hasAvatar ? $avatar->getURL(Avatar::SMALL) : $standardIcon;
} else {
$icon = $standardIcon;
}
$cnav = [ $cnav = [
'icon' => $icon, 'icon' => $icon,
'avatar' => $hasAvatar,
'title' => $course->getFullname(), 'title' => $course->getFullname(),
'url' => URLHelper::getURL($url, ['cid' => $course->id]), 'url' => URLHelper::getURL($url, ['cid' => $course->id]),
'parent' => 'browse/my_courses', 'parent' => 'browse/my_courses',
......
...@@ -242,8 +242,11 @@ $sidebarOut: -330px; ...@@ -242,8 +242,11 @@ $sidebarOut: -330px;
img, img,
svg { svg {
vertical-align: text-bottom; &:not(.avatar) {
filter: contrast(0) brightness(2);
}
margin-right: 10px; margin-right: 10px;
vertical-align: text-bottom;
} }
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
> >
<span class="navigation-icon"> <span class="navigation-icon">
<studip-icon v-if="isCourse" shape="seminar" role="info_alt" :size="24" alt=""></studip-icon> <studip-icon v-if="isCourse" shape="seminar" role="info_alt" :size="24" alt=""></studip-icon>
<img v-if="item.icon" :src="iconUrl" width="24" alt="" /> <img v-if="item.icon" :src="iconUrl" width="24" alt="" :class="{avatar: item.avatar}"/>
</span> </span>
<span class="navigation-text"> <span class="navigation-text">
{{ item.title }} {{ item.title }}
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
:aria-label="navigateToText(item.title)" :aria-label="navigateToText(item.title)"
> >
<studip-icon v-if="isCourse" shape="seminar" role="info_alt" :size="24" alt=""></studip-icon> <studip-icon v-if="isCourse" shape="seminar" role="info_alt" :size="24" alt=""></studip-icon>
<img v-if="item.icon" :src="iconUrl" width="24" alt="" /> <img v-if="item.icon" :src="iconUrl" width="24" alt="" :class="{avatar: item.avatar}"/>
{{ item.title }} {{ item.title }}
</a> </a>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment