feat(v2): allow to specify different logo for dark mode - #2261
Merged
Merged
Conversation
lex111
commented
Jan 31, 2020
| } | ||
| : null; | ||
| const logoImageUrl = useBaseUrl(logo.src); | ||
| const logoSrc = logo.darkSrc && isDarkTheme ? logo.darkSrc : logo.src; |
Contributor
Author
There was a problem hiding this comment.
Maybe is it better to move this expression to the hook call?
const logoImageUrl = useBaseUrl(logo.darkSrc && isDarkTheme ? logo.darkSrc : logo.src);
lex111
commented
Jan 31, 2020
| logo: { | ||
| alt: 'Site Logo', | ||
| src: 'img/logo.svg', | ||
| darkSrc: 'img/logo_dark.svg', // default to logo.src |
Contributor
Author
There was a problem hiding this comment.
Maybe is it better to rename to srcDark or just dark?
Contributor
There was a problem hiding this comment.
I think srcDark would be better.
Contributor
|
Deploy preview for docusaurus-2 ready! Built with commit c80c00c |
yangshun
approved these changes
Feb 1, 2020
yangshun
left a comment
Contributor
There was a problem hiding this comment.
Awesome, self-merge please!
| logo: { | ||
| alt: 'Site Logo', | ||
| src: 'img/logo.svg', | ||
| darkSrc: 'img/logo_dark.svg', // default to logo.src |
Contributor
There was a problem hiding this comment.
I think srcDark would be better.
| } | ||
| : null; | ||
| const logoImageUrl = useBaseUrl(logo.src); | ||
| const logoSrc = logo.darkSrc && isDarkTheme ? logo.darkSrc : logo.src; |
mrizwanashiq
pushed a commit
to mrizwanashiq/docusaurus
that referenced
this pull request
Jun 25, 2026
* feat(v2): allow to specify different logo for dark mode * Rename darkSrc with srcDark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Resolving of https://docusaurus.canny.io/admin/board/feature-requests/p/specify-different-dark-mode-logo
Since we have dark mode enabled by default, it makes sense to give our users the ability to set a different logo for dark mode.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Specify
logo.darkSrcfiled and switch to dark mode to make sure the logo has changed.Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)