-
Notifications
You must be signed in to change notification settings - Fork 11
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
dark mode #18
Comments
Keep using Dark Reader, paste this code into your @-moz-document domain(play.d2lang.com) {
/* NOTE: works alongside Dark Reader*/
/* alixanser's design color palette */
:root {
--background: #0a0f25;
--foreground: #e3e1dd;
--sketch-overlay-1: #070b67;
--sketch-overlay-2: #3733e9;
--database: #7240dd;
--file: #01799d;
}
/* TODO: change editor's caret color */
div[class="cursor monaco-mouse-cursor-text "] {
background-color: var(--foreground) !important;
}
#hero-center-drawing-img {
mix-blend-mode: overlay !important;
background-color: var(--foreground) !important;
}
/* background editor */
.margin, .monaco-editor, .monaco-editor-background {
background-color: var(--background) !important;
caret-color: revert !important;
}
/* background component */
[class^=" sketch-overlay-"] {
fill: var(--background) !important;
}
/* Text */
[class^="text-"] {
mix-blend-mode: difference !important;
}
/* Latex */
g[data-mml-node="math"] {
color: var(--foreground) !important;
}
/* SVG images */
/* required specific selector, not recommended */
/* [class*="fill-"] {
fill: var(--background) !important;
} */
[href^="data:image/svg+xml"] {
filter: invert(100%) sepia(0%) saturate(26%) hue-rotate(88deg) brightness(105%) contrast(108%) !important;
mix-blend-mode: difference !important;
}
} Of course, d2 supports custom styling, but the playground's UI is white and we want that to be dark mode as well. So disable Dark Reader is a no-go. UPDATE: Took me 3 hours to change to caret color :v |
@alixander Your design is truly beautiful, if you share the color palette I can work on it if I got some free time. |
Alternative: disable Dark Reader, use "Dark Mauve": vars: {
d2-config: {
layout-engine: dagre
theme-id: 200
}
} |
I don't have it handy right now, will in a few weeks, but I use a browser extension to get colors, maybe that could be helpful in the meantime: https://chromewebstore.google.com/detail/colorzilla/bhlhnicpbhignbdhedgjhgdocnmhomnp?hl=en We'd of course welcome & appreciate such a contribution. |
Yep I used Firefox DevTool Color Picker to extract some colors in your design. I will look into it soon. |
https://www.reddit.com/r/d2lang/comments/zrj6ip/please_add_dark_mode_to_the_playground_that_would/
The text was updated successfully, but these errors were encountered: