-
Notifications
You must be signed in to change notification settings - Fork 51
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 theme for custom formatters in devtools dark mode #30
Comments
Should be doable by providing alternative styling via config: cljs-devtools/src/lib/devtools/defaults.cljs Line 225 in 4b40423
Or maybe just overriding color table would be enough (not sure about background colors):
I'm personally not going to spend time on this. I don't use dark mode. But I would accept pull requests if someone would be willing to maintain dark mode config overrides. |
@timmywil I saw you forked the repo. I think maybe some background colors will be missing because I rely on defaults. Feel free to add new named colors or new css styles. Also I would recommend you to explore "invert" css filter first. You might be able to achieve good results simply inverting and maybe rotating hue at root level in |
Another tip (in case you were not aware): See https://developer.chrome.com/devtools/docs/debugger-protocol#remote |
Leaving this here for anyone that wants a quick solution. It uses manual installation: (ns main
(:require
[devtools.core :as devtools]))
(let [{:keys [cljs-land-style]} (devtools/get-prefs)]
(devtools/set-pref! :cljs-land-style (str "filter:invert(1);" cljs-land-style)))
(devtools/install!) Here's how it looks Thanks @darwin for the hints! |
You use a CSS media query to set styles based on the browser's dark mode setting like this:
I can't easily see how to include this clause to add the filter to just the |
@dvingo posted this snippet in the :compiler-options {:external-config
;; these are for legibility when using dark theme devtools
;; any of these can be overwritten
;; https://github.com/binaryage/cljs-devtools/blob/master/src/lib/devtools/defaults.cljs
{:devtools/config
{:keyword-style "color: #909113;"
:cljs-land-style "background: rgba(0,0,0,0);color:#eee;border-radius:2px;"
:string-style "color: #16b4c4;"
:symbol-style "color: rgb(239,194,194);"
:body-style "display:inline-block;padding:3px 12px;border-top:2px solid rgba(60,90,60,.1);margin:1px;margin-top:0px;background:transparent;"}}} |
I'm not sure how custom formatters work, but the logs are currently hard to read when devtools is in dark mode. I imagine the colors are customizable, but it would be nice if the default formatters had a config option for viewing in dark mode (any dark foreground colors would be swapped with lighter ones).
The text was updated successfully, but these errors were encountered: