move theme toggle to fixed bottom-right corner
Repositions the dark/light mode button from the header to a fixed position in the bottom-right corner (always visible). Bumps size to 44px for WCAG touch target compliance. Also makes login text and icon white in dark mode. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
74334e7590
commit
1e3b62d942
@@ -128,6 +128,10 @@
|
|||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[data-bs-theme="dark"] #login-div {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
/* Accessible focus indicators for primary navigation elements */
|
/* Accessible focus indicators for primary navigation elements */
|
||||||
#hamburger:focus,
|
#hamburger:focus,
|
||||||
#hamburger:focus-visible,
|
#hamburger:focus-visible,
|
||||||
@@ -532,20 +536,23 @@
|
|||||||
|
|
||||||
/* dark mode toggle button */
|
/* dark mode toggle button */
|
||||||
#theme-toggle {
|
#theme-toggle {
|
||||||
float: right;
|
position: fixed;
|
||||||
|
bottom: 20px;
|
||||||
|
right: 20px;
|
||||||
|
z-index: 9999;
|
||||||
background: none;
|
background: none;
|
||||||
border: 2px solid var(--kbccblue);
|
border: 2px solid var(--kbccblue);
|
||||||
color: var(--kbccblue);
|
color: var(--kbccblue);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
width: 40px;
|
width: 44px;
|
||||||
height: 40px;
|
height: 44px;
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
|
transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
|
||||||
margin-top: 5px;
|
background-color: var(--bg);
|
||||||
}
|
}
|
||||||
#theme-toggle:hover {
|
#theme-toggle:hover {
|
||||||
background-color: var(--kbccblue);
|
background-color: var(--kbccblue);
|
||||||
|
|||||||
@@ -76,14 +76,6 @@
|
|||||||
<div id="login-text">Login</div>
|
<div id="login-text">Login</div>
|
||||||
<div id="login-icon"><i class="fas fa-user" aria-hidden="true"></i></div>
|
<div id="login-icon"><i class="fas fa-user" aria-hidden="true"></i></div>
|
||||||
</a>
|
</a>
|
||||||
<button
|
|
||||||
id="theme-toggle"
|
|
||||||
@click="toggleTheme"
|
|
||||||
:aria-label="isDark ? 'Switch to light mode' : 'Switch to dark mode'"
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
<i :class="isDark ? 'fas fa-sun' : 'fas fa-moon'" aria-hidden="true"></i>
|
|
||||||
</button>
|
|
||||||
<img
|
<img
|
||||||
id="library-logo"
|
id="library-logo"
|
||||||
class="image-fail"
|
class="image-fail"
|
||||||
@@ -102,6 +94,14 @@
|
|||||||
<!-- end of col-xs-12 -->
|
<!-- end of col-xs-12 -->
|
||||||
</div>
|
</div>
|
||||||
<!--end of row-->
|
<!--end of row-->
|
||||||
|
<button
|
||||||
|
id="theme-toggle"
|
||||||
|
@click="toggleTheme"
|
||||||
|
:aria-label="isDark ? 'Switch to light mode' : 'Switch to dark mode'"
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
<i :class="isDark ? 'fas fa-sun' : 'fas fa-moon'" aria-hidden="true"></i>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<!--end of Vue app1-->
|
<!--end of Vue app1-->
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user