Fix theme icon in transparent menu (#801)
Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
parent
5f0aebcf68
commit
c943f39617
3 changed files with 11 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
const updateNavBar = () => {
|
const updateNavBar = () => {
|
||||||
const topNavbar = document.getElementById('top-navbar')
|
const topNavbar = document.getElementById('top-navbar')
|
||||||
const navbarToggler = document.getElementById('navbar-toggler')
|
const navbarToggler = document.getElementById('navbar-toggler')
|
||||||
|
const themeIcon = document.getElementById('navbar-theme-icon-svg')
|
||||||
|
|
||||||
if (window.scrollY > 40) {
|
if (window.scrollY > 40) {
|
||||||
topNavbar?.classList.remove('transparent-navbar')
|
topNavbar?.classList.remove('transparent-navbar')
|
||||||
|
@ -9,6 +10,8 @@ const updateNavBar = () => {
|
||||||
navbarToggler?.classList.remove('navbar-dark')
|
navbarToggler?.classList.remove('navbar-dark')
|
||||||
navbarToggler?.classList.add('navbar-light')
|
navbarToggler?.classList.add('navbar-light')
|
||||||
|
|
||||||
|
// color theme selector a.k.a. dark mode
|
||||||
|
themeIcon?.classList.remove('svg-inverted')
|
||||||
|
|
||||||
// get the main logo from hidden img tag
|
// get the main logo from hidden img tag
|
||||||
const mainLogo = document.getElementById('main-logo')
|
const mainLogo = document.getElementById('main-logo')
|
||||||
|
@ -23,6 +26,9 @@ const updateNavBar = () => {
|
||||||
navbarToggler?.classList.remove('navbar-light')
|
navbarToggler?.classList.remove('navbar-light')
|
||||||
navbarToggler?.classList.add('navbar-dark')
|
navbarToggler?.classList.add('navbar-dark')
|
||||||
|
|
||||||
|
// color theme selector a.k.a. dark mode
|
||||||
|
themeIcon?.classList.add('svg-inverted')
|
||||||
|
|
||||||
// get the inverted logo from hidden img tag
|
// get the inverted logo from hidden img tag
|
||||||
const invertedLogo = document.getElementById('inverted-logo')
|
const invertedLogo = document.getElementById('inverted-logo')
|
||||||
if (invertedLogo) {
|
if (invertedLogo) {
|
||||||
|
|
|
@ -42,3 +42,7 @@ html[data-theme='dark'] {
|
||||||
color: get-dark-color('muted-text-color');
|
color: get-dark-color('muted-text-color');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.svg-inverted {
|
||||||
|
filter: invert(1);
|
||||||
|
}
|
||||||
|
|
|
@ -184,7 +184,7 @@
|
||||||
background-color: get-light-color('bg-primary');
|
background-color: get-light-color('bg-primary');
|
||||||
box-shadow: $box-shadow;
|
box-shadow: $box-shadow;
|
||||||
}
|
}
|
||||||
#themeMenu{
|
#themeMenu {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue