1
0
mirror of https://github.com/kognise/water.css.git synced 2025-08-13 16:44:58 +02:00

feat: adjust favicon to dark mode

This commit is contained in:
Jonas Kuske
2019-06-02 04:46:52 +02:00
parent 26aecd86db
commit 4673919b7c
5 changed files with 22 additions and 3 deletions

BIN
icons/light-favicon-16x16.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
icons/light-favicon-32x32.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
icons/light-favicon.ico Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -202,7 +202,8 @@
<h5>Heading 5</h5>
<h6>Heading 6</h6>
<script src='script.js'></script>
<script src="https://unpkg.com/favicon-mode-switcher@^1.0.0" defer></script>
<script src="script.js" defer></script>
</body>
</html>
</html>

View File

@@ -1,4 +1,22 @@
(function (ThemeSwitcher) {
!(function() {
const iconModeSwitcher = window.faviconModeSwitcher && faviconModeSwitcher.default
if (!iconModeSwitcher) return
iconModeSwitcher([
{
element: 'link[rel="shortcut icon"]',
href: { dark: '/icons/light-favicon.ico' }
},
{
element: 'link[rel="icon"][sizes="16x16"]',
href: { dark: '/icons/light-favicon-16x16.png' }
},
{
element: 'link[rel="icon"][sizes="32x32"]',
href: { dark: '/icons/light-favicon-32x32.png' }
}
])
})()
;(function (ThemeSwitcher) {
const themeSwitcher = new ThemeSwitcher('stylesheet');
const themeSwitchBtn = document.getElementById('switch');
const themes = {