-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
feat(v2): dark mode toggle customization #3127
feat(v2): dark mode toggle customization #3127
Conversation
Deploy preview for docusaurus-2 ready! Built with commit 503c613 |
1c92cc1
to
4846ae1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that seems almost fine.
I'd like a few changes:
- Fix e2e tests when colorMode=undefined
- Add unit tests for such edge cases so it never happen again
- Add documentation
if that helps here's a pr where I validate algolia theme config: https://github.com/facebook/docusaurus/pull/3133/files |
…ark-toggle-customization
…ark-toggle-customization
I opted to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that looks nice
mergeDefault should not be used in production code, Joi already does that. it's only useful for the tests
What do you mean? which nested config field exactly?
All config options should be documented, so if it's not in the doc already, it should be added |
I've added some more comments to the documentation about the styling options. |
thanks that looks good :) |
Motivation
Feature was requested in #3052
Have you read the Contributing Guidelines on pull requests?
Yes
Does it work
The approach I took allows users to include any css that would work in an inline react
style
prop. This disqualifies attributes such ascontent
as it requires the ::before selector.This approach allows users to customize the margin or other styling of any text or emoji they choose.
Docs
Added the new fields to the API
themeConfig
section of thedocusaurus.config.js
docI was considering including a link to this page where they explain about how react does inline css. Let me know if you think it needs it.