You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dark theme for custom formatters in devtools dark mode #30
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).
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 :cljs-land-style.
Another tip (in case you were not aware):
You can start chrome with --remote-debugging-port and then inspect DevTools instance with custom formatted output using another (independent) DevTools. This way you can inspect rendered custom formatters html structure in Elements panel.
Reacted by Antonin Hildebrand, Ryan De La Torre, Christopher Joslyn, William Calderipe, Carina, Grigory Shepelev, Björn Ebbinghaus, Jarppe, Akhil Wali, Baruch Berger and 11 more
I can't easily see how to include this clause to add the filter to just the :cljs-land-style. It kind of needs to be in a new CSS section rather than modifying the current :cljs-land-style I think. If @darwin can give me a hint as to how I could include/append this extra piece of CSS I can test and put a PR together.
@dvingo posted this snippet in the shadow-cljs Slack channel which works great when added to your build target in shadow-cljs.edn:
: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;"}}}
Reacted by Antonin Hildebrand, Franco Biasin, Daniel Vingo, Ray Stubbs, Luciano Maiwald and Michael Salihi
Activity
darwin commentedon Nov 10, 2016
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):
cljs-devtools/src/lib/devtools/defaults.clj
Line 8 in 4b40423
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.
darwin commentedon Nov 11, 2016
@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
:cljs-land-style.darwin commentedon Nov 11, 2016
Another tip (in case you were not aware):
You can start chrome with
--remote-debugging-portand then inspect DevTools instance with custom formatted output using another (independent) DevTools. This way you can inspect rendered custom formatters html structure in Elements panel.See https://developer.chrome.com/devtools/docs/debugger-protocol#remote
frankitox commentedon Aug 10, 2020
Leaving this here for anyone that wants a quick solution. It uses manual installation:
Here's how it looks
Thanks @darwin for the hints!
chr15m commentedon Aug 19, 2023
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
:cljs-land-style. It kind of needs to be in a new CSS section rather than modifying the current:cljs-land-styleI think. If @darwin can give me a hint as to how I could include/append this extra piece of CSS I can test and put a PR together.chr15m commentedon Nov 24, 2023
@dvingo posted this snippet in the
shadow-cljsSlack channel which works great when added to your build target inshadow-cljs.edn::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;"}}}