Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching themes does not work properly #1177

Open
markdumay opened this issue Sep 9, 2024 Discussed in #1139 · 1 comment
Open

Switching themes does not work properly #1177

markdumay opened this issue Sep 9, 2024 Discussed in #1139 · 1 comment
Labels
bug Something isn't working

Comments

@markdumay
Copy link
Collaborator

Discussed in #1139

Originally posted by massrez August 27, 2024
Mark, hello.
Thank you for your work. The theme is great.
I want to point out that switching themes (dark - light) does not work properly for navbar.

To get the theme switching error, you need to scroll down the page, switch the theme, go back up and try to switch again.

the error is related to <nav class="navbar p-4 navbar-fixed-top navbar-expand-lg" data-bs-theme="dark" style="--bs-navbar-expanded-color: var(--bs-body-bg);">
namely the value of the variable
data-bs-theme="dark"
data-bs-theme="light"

in versions where everything worked correctly
the value was data-bs-theme="null"
(in the position of the page scroll up)

to fix it, you need to edit the navbar.js file
responsible code
if (defaultTheme) {
navbar.setAttribute('data-bs-theme', defaultTheme)
}

the specified incorrect work is easily reproduced on gethinode.com

@markdumay markdumay added the bug Something isn't working label Sep 9, 2024
@markdumay
Copy link
Collaborator Author

Thanks for sharing this issue @massrez. I've converted the conversation into a bug, so I can better track its progress. I'm able to reproduce the error following the steps you described. I'll look into it.

@markdumay markdumay changed the title Switching themes does not work properly. Switching themes does not work properly Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant