Browse Source

Fix appmenu svg double invert

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>
tags/v13.0.0RC1
Julius Härtl 6 years ago
parent
commit
927626cbaa
No account linked to committer's email address
2 changed files with 16 additions and 14 deletions
  1. 10
    6
      apps/theming/css/theming.scss
  2. 6
    8
      core/templates/layout.user.php

+ 10
- 6
apps/theming/css/theming.scss View File

@@ -20,10 +20,12 @@
}

@if (luma($color-primary) > 0.6) {
#appmenu img,
#appmenu image {
#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;
}
@@ -67,10 +69,12 @@
}
}
} @else {
#appmenu img,
#appmenu image {
filter: none;
}
#appmenu:not(.inverted) svg {
filter: none;
}
#appmenu.inverted svg {
filter: invert(1);
}
}

/* Colorized svg images */

+ 6
- 8
core/templates/layout.user.php View File

@@ -41,19 +41,17 @@
</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']); ?>"
<?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>

Loading…
Cancel
Save