better-roam-research icon indicating copy to clipboard operation
better-roam-research copied to clipboard

Any plans to improve code-block in dark mode?

Open intel352 opened this issue 3 years ago • 3 comments

It would be nice to have code blocks also represent dark mode theme, with a dark background. Any plan on implementing this?

intel352 avatar May 06 '22 15:05 intel352

I'm not a visual designer, prefer to leave that up to people that have an actual eye for it, but I've identified some styles that need to be overridden for code block styling in dark mode.

I updated the CSS block to the below:

@import url("https://linuz90.github.io/better-roam-research/main.css");
.cmt-punctuation {
  color: #67d8ef;
}
.cmt-propertyName {
  color: #ac80f7;
}
#text, .cmt-operator {
  color: #A9A9A9;
}
.cmt-labelName, .cmt-atom {
  color: #167;
}
body, .roam-body, .roam-app, .rm-pages-title-text {
  color: #09a9e3 !important;
}
span.bp3-button-text {
  color: #020024;
}
.rm-code-block {
  background-color: #213238;
}
.c2 .cm-gutters {
  background-color: #e5e5e5;
  color: #999;
}

It looks like shit still (screenshot attached), but it's at least legible, which can't be said for code block in the current dark-mode theme. Screen Shot 2022-06-29 at 11 59 01 AM

intel352 avatar Jun 29 '22 15:06 intel352

If anyone comes up with some better overrides, please do share. Thanks!

intel352 avatar Jun 29 '22 16:06 intel352

Thanks @intel352 , this has been bothering me too - using your solution now until I have the time/energy to tweak the colours... with one slight modification. Replacing the selector:

body, .roam-body, .roam-app, .rm-pages-title-text

with:

cm-line

Means it only overrides the text colour within code blocks and not all text everywhere. Complete example:

@import url("https://linuz90.github.io/better-roam-research/main.css");
.cmt-punctuation {
  color: #67d8ef;
}
.cmt-propertyName {
  color: #ac80f7;
}
#text, .cmt-operator {
  color: #A9A9A9;
}
.cmt-labelName, .cmt-atom {
  color: #167;
}
.cm-line {
  color: #09a9e3 !important;
}
span.bp3-button-text {
  color: #020024;
}
.rm-code-block {
  background-color: #213238;
}
.c2 .cm-gutters {
  background-color: #e5e5e5;
  color: #999;
}

blairharper avatar Sep 04 '22 11:09 blairharper