]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix appmenu svg double invert 7817/head
authorJulius Härtl <jus@bitgrid.net>
Wed, 10 Jan 2018 08:11:17 +0000 (09:11 +0100)
committerJulius Härtl <jus@bitgrid.net>
Fri, 12 Jan 2018 13:35:44 +0000 (14:35 +0100)
This fixes a regression caused by 9b668d0, where the css filters to
preview color inversion of the app menu was applied by default. This
commit makes the css filters sensitive on what the current state of the
app menu is.

Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/theming/css/theming.scss
core/templates/layout.user.php

index acf4d6446f4834292e89b83da0b18e034b01dac3..2a40edd49d9e6851ef703663af8bf137d938836f 100644 (file)
 }
 
 @if (lightness($color-primary) > 50) {
+       #appmenu:not(.inverted) svg {
+               filter: invert(1);
+       }
+       #appmenu.inverted svg {
+               filter: none;
+       }
        .searchbox input[type="search"] {
                background: transparent url('../../../core/img/actions/search.svg') no-repeat 6px center;
        }
                        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 */
index d54a6fe114ffa9a21b508c74d8af326d1be86ae0..2a413a4d9580ea61ea1e1bdaee695c7cf8c5172f 100644 (file)
                                        <div class="icon-caret"></div>
                                </a>
 
-                               <ul id="appmenu">
+                               <ul id="appmenu" <?php if ($_['themingInvertMenu']) { ?>class="inverted"<?php } ?>>
                                        <?php foreach ($_['navigation'] as $entry): ?>
                                                <li data-id="<?php p($entry['id']); ?>" class="hidden">
                                                        <a href="<?php print_unescaped($entry['href']); ?>"
                                                           tabindex="3"
                                                                <?php if ($entry['active']): ?> class="active"<?php endif; ?>>
-                                                               <?php if ($_['themingInvertMenu']) { ?>
                                                                        <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>
-                                                                       <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>
-                                                               <?php } else { ?>
-                                                                       <img src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>"
-                                                                                class="app-icon" alt="<?php p($entry['name']); ?>" />
-                                                               <?php } ?>
+                                                                               <?php if ($_['themingInvertMenu']) { ?>
+                                                                               <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 } ?>
+                                                                               <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" />
+                                                                       </svg>
                                                                <div class="icon-loading-small-dark"
                                                                         style="display:none;"></div>
                                                        </a>