-
Notifications
You must be signed in to change notification settings - Fork 55
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
refactor: make some dark mode colors less contrast #237
Conversation
Size Change: -9.76 kB (-2%) Total Size: 569 kB
ℹ️ View Unchanged
|
Dist CSS Diffdiff --git a/packages/core/dist/css/default/default.css b/packages/core/dist-branch/css/default/default.css
index d4458d2..4266566 100644
--- a/packages/core/dist/css/default/default.css
+++ b/packages/core/dist-branch/css/default/default.css
@@ -185,7 +185,7 @@
--ifm-code-padding-horizontal: 0.1rem;
--ifm-code-padding-vertical: 0.1rem;
- --ifm-pre-background: var(--ifm-color-emphasis-100);
+ --ifm-pre-background: var(--ifm-code-background);
--ifm-pre-border-radius: var(--ifm-code-border-radius);
--ifm-pre-color: inherit;
--ifm-pre-line-height: 1.45;
@@ -2961,23 +2961,26 @@ html[data-theme='dark'] {
--ifm-color-emphasis-900: var(--ifm-color-gray-100);
--ifm-color-emphasis-1000: var(--ifm-color-gray-0);
- --ifm-background-color: #18191a;
+ --ifm-background-color: #1b1b1d;
--ifm-background-surface-color: #242526;
--ifm-hover-overlay: rgba(255, 255, 255, 0.05);
+ --ifm-color-content: #e3e3e3;
--ifm-color-content-secondary: rgba(255, 255, 255, 1);
--ifm-breadcrumb-separator-filter: invert(64%) sepia(11%) saturate(0%)
hue-rotate(149deg) brightness(99%) contrast(95%);
- --ifm-code-background: rgb(51, 52, 55);
+ --ifm-code-background: rgba(255, 255, 255, 0.1);
--ifm-scrollbar-track-background-color: #444444;
--ifm-scrollbar-thumb-background-color: #686868;
--ifm-scrollbar-thumb-hover-background-color: #7a7a7a;
--ifm-table-stripe-background: rgba(255, 255, 255, 0.07);
+
+ --ifm-toc-border-color: var(--ifm-color-emphasis-200);
--ifm-color-primary-contrast-background: rgb(16, 36, 69);
--ifm-color-primary-contrast-foreground: rgb(235, 242, 252);
--ifm-color-secondary-contrast-background: rgb(71, 71, 72); |
✅ Deploy Preview for infima ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
4dbe571
to
c13dce1
Compare
Can we also brighten the background a bit so it approaches ~12.5? |
I tried to do something with the background too, but it is quite unusually bright then, maybe decrease its brightness just a little bit so that the contrast ratio ends up being 13.4. |
I'm looking at the CF docs which IMO is the closest to ours (the others are a bit too... colorful). Their background seems to be grayer than us. But looking at the deploy demo, this change already looks much, much better than before. |
Yes, since I don't have a clear understanding of what dark mode should be at all, I just want avoid to make abrupt changes, so the new contrast ratio seems quite good. |
Same, I don't even know what dark mode should look like 😄 But everyone seems to implement it differently anyways |
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.
We can give this a try 👍
Wondering if it's not worth it to make category/toc/navbar/title lighter, and only darken main text and walls of text?
This looks a little bit sad to me
Compared to other docs like Cloudflare where some elements stand out a bit more:
but Microsoft docs also looks a bit sad so 🤷♂️
Note: Cloudflare uses a different color for markdown titles, and IMHO that feels more "alive"
--ifm-code-background: color-mod( | ||
var(--ifm-color-gray-900) tint(var(--ifm-dark-value)) | ||
); | ||
--ifm-code-background: rgba(255, 255, 255, 0.08); |
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.
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.
Hmm, maybe we should make background for code blocks (pre) the same as for inline code background?
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.
This is always overridden in practice by Prism themes anyways, not critical.
I wouldn't do that yet, the current result is quite good. |
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.
I think this is all good, no changes needed. @lex111 Ready for merge?
@slorber I'm not aware of a place where the pre background is actually used in Docusaurus, unless the user uses |
Should be better this time -- the background for inline blocks is darker, and it is also used for multi-line code blocks. |
LGTM 👍 |
Related to #199
After doing a little studying of dark mode sites, I've come to the conclusion that it's really worth using less contrast for base content color if dark mode is on:
Current dark mode contrast ratio - 16.27
New one -
13.7113.4This is quite subjective, but the current contrast ratio is a bit of an inconvenience, so darkening the current content color would not be superfluous, given that in fact many sites use less contrast color in general.