Merge pull request #7817 from nextcloud/stable12-7767

[stable12] Fix preview when theming changes invertion of icons
This commit is contained in:
Roeland Jago Douma 2018-01-16 19:18:56 +01:00 committed by GitHub
commit 7a7e756b0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 8 deletions

View File

@ -11,6 +11,12 @@
} }
@if (lightness($color-primary) > 50) { @if (lightness($color-primary) > 50) {
#appmenu:not(.inverted) svg {
filter: invert(1);
}
#appmenu.inverted svg {
filter: none;
}
.searchbox input[type="search"] { .searchbox input[type="search"] {
background: transparent url('../../../core/img/actions/search.svg') no-repeat 6px center; background: transparent url('../../../core/img/actions/search.svg') no-repeat 6px center;
} }
@ -48,6 +54,13 @@
background-color: nc-darken($color-primary-element, 30%) !important; background-color: nc-darken($color-primary-element, 30%) !important;
} }
} }
} @else {
#appmenu:not(.inverted) svg {
filter: none;
}
#appmenu.inverted svg {
filter: invert(1);
}
} }
/* Colorized svg images */ /* Colorized svg images */

View File

@ -60,20 +60,18 @@
<div class="icon-caret"></div> <div class="icon-caret"></div>
</a> </a>
<ul id="appmenu"> <ul id="appmenu" <?php if ($_['themingInvertMenu']) { ?>class="inverted"<?php } ?>>
<?php foreach ($_['navigation'] as $entry): ?> <?php foreach ($_['navigation'] as $entry): ?>
<li data-id="<?php p($entry['id']); ?>" class="hidden"> <li data-id="<?php p($entry['id']); ?>" class="hidden">
<a href="<?php print_unescaped($entry['href']); ?>" <a href="<?php print_unescaped($entry['href']); ?>"
tabindex="3" tabindex="3"
<?php if ($entry['active']): ?> class="active"<?php endif; ?>> <?php if ($entry['active']): ?> class="active"<?php endif; ?>>
<?php if ($_['themingInvertMenu']) { ?>
<svg width="20" height="20" viewBox="0 0 20 20"> <svg width="20" height="20" viewBox="0 0 20 20">
<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> <?php if ($_['themingInvertMenu']) { ?>
<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> <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>
<?php } else { ?> <?php } ?>
<img src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>" <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" />
class="app-icon" alt="<?php p($entry['name']); ?>" /> </svg>
<?php } ?>
<div class="icon-loading-small-dark" <div class="icon-loading-small-dark"
style="display:none;"></div> style="display:none;"></div>
</a> </a>