Fix visual bug in chrome while changing themes

This commit is contained in:
ReimarPB 2023-09-09 18:06:32 +02:00
parent f7fcf6788c
commit 24524a20fe
5 changed files with 21 additions and 9 deletions

View File

@ -4,5 +4,5 @@
<rect x="0" y="0" width="50" height="100" fill="white" />
</mask>
<circle cx="50" cy="50" r="50" fill="black" mask="url(#mask)" />
<circle cx="50" cy="50" r="45" fill-opacity="0" stroke="black" stroke-width="10" />
<circle cx="50" cy="50" r="45" fill-opacity="0" stroke="currentColor" stroke-width="10" />
</svg>

Before

Width:  |  Height:  |  Size: 366 B

After

Width:  |  Height:  |  Size: 373 B

View File

@ -76,3 +76,4 @@ body {
.light {
display: none !important;
}

View File

@ -76,3 +76,4 @@ body {
.dark {
display: none !important;
}

View File

@ -214,6 +214,14 @@ h1, h2 {
float: right;
}
.light, .dark {
display: none;
}
.icon-wrapper {
display: inline-block;
width: 1em;
}
.icon {
-ms-interpolation-mode: nearest-neighbor;
display: inline-block;

View File

@ -4,6 +4,7 @@
<div class="section container" style="font-size: 14px;">
<h2>Theme</h2>
<?php foreach (["auto", "light", "dark"] as $theme): ?>
<div class="icon-wrapper">
<picture class="light">
<source type="image/svg+xml" srcset="/assets/icons/light-mode/theme-<?= $theme ?>.svg">
<img class="icon" src="/assets/icons/light-mode/theme-<?= $theme ?>.png" alt="">
@ -12,6 +13,7 @@
<source type="image/svg+xml" srcset="/assets/icons/dark-mode/theme-<?= $theme ?>.svg">
<img class="icon" src="/assets/icons/dark-mode/theme-<?= $theme ?>.png" alt="">
</picture>
</div>
<span id="<?= $theme ?>-theme">
<a class="theme-btn" data-theme="<?= $theme ?>" href="/api/set_theme/<?= $name ?>.php">
<?= ucwords($theme) ?>