question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

[v2] Allow Custom Dark Mode Toggle Emoji

See original GitHub issue

๐Ÿš€ Feature

https://github.com/facebook/docusaurus/pull/1529 added emojis for the dark mode toggle that uses ๐ŸŒž (Sun with Face) and ๐ŸŒœ (Last Quarter Moon Face).

Screen Shot 2020-07-11 at 11 28 43 PM Screen Shot 2020-07-11 at 11 28 49 PM

While this is a nice touch, the choice of these emojis can look a bit un-professional when there are many other choices that are more neutral and less whimsical.

In my project, I have used this piece of CSS to hack around this and replace those emojis with the โ˜€๏ธ (sun) and ๐ŸŒ™ (crescent-moon) emojis:

.react-toggle-track-check>span::before {
  content: '\1F319';
}
.react-toggle-track-x>span::before {
  content: '\2600';
  color: #ffd557;
}
Screen Shot 2020-07-11 at 11 30 50 PM Screen Shot 2020-07-11 at 11 30 55 PM

There are many other options (like an on/off lightbulb) that users may want, so why not make this configurable?

For reference, this is where the emojis are hardcoded in Docusaurus: https://github.com/facebook/docusaurus/blob/5ccd24cc1f07efbd4e7c3fe68937e357c0e44855/packages/docusaurus-theme-classic/src/theme/Toggle/styles.module.css#L19-L24

And this is where they are set into the component: https://github.com/facebook/docusaurus/blob/5ccd24cc1f07efbd4e7c3fe68937e357c0e44855/packages/docusaurus-theme-classic/src/theme/Toggle/index.tsx#L16-L17

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Drewbicommented, Aug 3, 2020

@adrianmcli That is a good spot to put it, I must have missed seeing this when I was adding documentation. I added a brief example in the API page but Iโ€™ll add some more here today. Thanks

2reactions
Drewbicommented, Aug 2, 2020

Feature has been released so we can close this ๐Ÿ˜ƒ

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFE: dark/light mode options for custom emoji - Discourse Meta
The problem is: that looks great in light mode, but fails in dark mode. ... It would be lovely if the custom emoji...
Read more >
Emoji vs. Switch for choosing light/dark theme on a navigation ...
More recently, I decided to replace the switch and text with emojiโ€”a sun for light mode, and a moon for dark mode:.
Read more >
Dark Mode Toggle Pro - WordPress plugin - ScriptsTown
Dark Mode Toggle Pro is a WordPress premium plugin to bring dark or night mode ... Dark Mode on Post Editor; Custom Button...
Read more >
What would be a technical solution to โœ”๏ธ not looking good ...
We'd want some awareness of which emojis are and aren't visible in dark mode. We would only want to give those that treatment....
Read more >
[Update: Rolling out globally] Facebook Messenger's Dark ...
As it turns out, Dark Mode on Facebook Messenger can be enabled by simply sending out a moon emoji in a chat. Read...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found