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

[v2] Bug with dark mode logo #2308

Closed
prma85 opened this issue Feb 20, 2020 · 2 comments · Fixed by #2324
Closed

[v2] Bug with dark mode logo #2308

prma85 opened this issue Feb 20, 2020 · 2 comments · Fixed by #2324
Assignees
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@prma85
Copy link

prma85 commented Feb 20, 2020

🐛 Bug Report

Based on the PR #2261

When using the dark logo option, it will work only for the switch button. The default logo will always the loaded, even if the first render is dark mode.

Using version 2.0.0-aplha.43

To Reproduce

  1. Define you logo and dark logo in the docusaurus.config.js
navbar: {
  logo: {
    alt: "iQmetrix - Hub.Docs",
    src: "img/logo-black.svg",
    srcDark: "img/logo-white.svg"
  }
}
  1. Load you site, and it should work
  2. Switch to dark mode, use the site and close it
  3. Open the site again, it will open the site in the dark mode, and you will see the default logo and not the dark option one

Expected behavior

Docusaurus would always check which theme the user is using to select the right logo and not only when using the switch button.

Actual Behavior

Docusaurus always load the default logo at the first load, and don't check if you are using dark theme or not.

Reproducible Demo

(Paste the link to an example repo, including a siteConfig.js, and exact instructions to reproduce the issue.)

https://iqmetrix.github.io/hub.docs/

@prma85 prma85 added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Feb 20, 2020
@prma85 prma85 changed the title [v2 [v2] Bug with dark mode logo Feb 20, 2020
@lex111 lex111 added this to the v2.0.0-alpha.44 milestone Feb 23, 2020
@yangshun yangshun self-assigned this Feb 24, 2020
@yangshun yangshun removed the status: needs triage This issue has not been triaged by maintainers label Feb 24, 2020
@lex111 lex111 assigned lex111 and unassigned yangshun Feb 24, 2020
@ismailvtl
Copy link

ismailvtl commented Apr 16, 2020

I added the following CSS as quick fix :)

html[data-theme='dark'] .navbar .navbar__logo { content: url(/img/dark-mode-logo.svg) }

@prma85
Copy link
Author

prma85 commented Apr 16, 2020

I added the following CSS as quick fix :)

html[data-theme='dark'] .navbar .navbar__logo { content: url(/img/dark-mode-logo.svg) }

This is fixed now!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants