Skip to content

Commit 7a7e756

Browse files
authored
Merge pull request #7817 from nextcloud/stable12-7767
[stable12] Fix preview when theming changes invertion of icons
2 parents a3059d0 + 394f1d8 commit 7a7e756

2 files changed

Lines changed: 19 additions & 8 deletions

File tree

apps/theming/css/theming.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
}
1212

1313
@if (lightness($color-primary) > 50) {
14+
#appmenu:not(.inverted) svg {
15+
filter: invert(1);
16+
}
17+
#appmenu.inverted svg {
18+
filter: none;
19+
}
1420
.searchbox input[type="search"] {
1521
background: transparent url('../../../core/img/actions/search.svg') no-repeat 6px center;
1622
}
@@ -48,6 +54,13 @@
4854
background-color: nc-darken($color-primary-element, 30%) !important;
4955
}
5056
}
57+
} @else {
58+
#appmenu:not(.inverted) svg {
59+
filter: none;
60+
}
61+
#appmenu.inverted svg {
62+
filter: invert(1);
63+
}
5164
}
5265

5366
/* Colorized svg images */

core/templates/layout.user.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,18 @@
6060
<div class="icon-caret"></div>
6161
</a>
6262

63-
<ul id="appmenu">
63+
<ul id="appmenu" <?php if ($_['themingInvertMenu']) { ?>class="inverted"<?php } ?>>
6464
<?php foreach ($_['navigation'] as $entry): ?>
6565
<li data-id="<?php p($entry['id']); ?>" class="hidden">
6666
<a href="<?php print_unescaped($entry['href']); ?>"
6767
tabindex="3"
6868
<?php if ($entry['active']): ?> class="active"<?php endif; ?>>
69-
<?php if ($_['themingInvertMenu']) { ?>
7069
<svg width="20" height="20" viewBox="0 0 20 20">
71-
<defs><filter id="invertMenuMain-<?php p($entry['id']); ?>"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" /></filter></defs>
72-
<image x="0" y="0" width="20" height="20" preserveAspectRatio="xMinYMin meet" filter="url(#invertMenuMain-<?php p($entry['id']); ?>)" xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>" class="app-icon" /></svg>
73-
<?php } else { ?>
74-
<img src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>"
75-
class="app-icon" alt="<?php p($entry['name']); ?>" />
76-
<?php } ?>
70+
<?php if ($_['themingInvertMenu']) { ?>
71+
<defs><filter id="invertMenuMain-<?php p($entry['id']); ?>"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" /></filter></defs>
72+
<?php } ?>
73+
<image x="0" y="0" width="20" height="20" preserveAspectRatio="xMinYMin meet"<?php if ($_['themingInvertMenu']) { ?> filter="url(#invertMenuMain-<?php p($entry['id']); ?>)"<?php } ?> xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>" class="app-icon" />
74+
</svg>
7775
<div class="icon-loading-small-dark"
7876
style="display:none;"></div>
7977
</a>

0 commit comments

Comments
 (0)