Skip to content
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

Allow the "light"/"dark" mode for GUI elements to be configured independently of the Editor theme #10754

Open
iron0012 opened this issue Mar 8, 2022 · 5 comments

Comments

@iron0012
Copy link

@iron0012 iron0012 commented Mar 8, 2022

I strongly prefer a dark-themed editor, but all other UI elements to be light-themed (or "unthemed" and light by default). This was possible in Rstudio until recently, when the "Classic" theme was removed. Now, since "Classic" theme was removed, if the editor is dark-themed, all other GUI elements are also dark, and if the editor is light-themed, all other GUI elements are also light.

Here is the appearance I desire, from a somewhat older version of Rstudio. This is "Classic" theme with "cobalt" editor theme:
CEF164B6-985D-4DF7-A550-5648AADB2167

Here is the undesirable "all UI elements are dark" mode that I am now forced into when I use any Rstudio theme ("modern" is shown, but "sky" is identical) with the "cobalt" theme:
image

I have been able to come close to replicating the appearance I desire by:

  1. start with a dark .tmTheme file (I'm using a variant of Cobalt)
  2. convert the theme with rstudioapi::convertTheme() and save to a specified directory
rstudioapi::convertTheme(
  themePath = '/Downloads/cobalt2.tmTheme',
  add = FALSE,
  outputLocation = '/Downloads/',
  apply = FALSE
)
  1. Open the resulting .rstheme file in a text editor, and on line 2 manually change rs-theme-is-dark from TRUE to FALSE

  2. use rstudioapi::addTheme() to add the modified theme back into rstudio

rstudioapi::addTheme(
  themePath = '/Downloads/cobalt2.rstheme'
)

The resulting appearance is very close, but notice that the "Environment" and "Files" panels still have a dark background (as does the "Packages" panel).
As a result, the blue "hyperlinks" to the files that appear in the Files pane (as well as the Packages that appear in the Packages pane) are nearly invisible against the dark background. Ideally, I would either want the background for the Files and Packages (and maybe Environment) panels to be light-colored while the Editor and Console panels remain dark colored. Alternatively, I would like to be able to change the "hyperlink-like" entries for files in the Files panel (and packages in the Packages panel) from blue to some other, lighter color so that they stand out legibly against the dark background. I have not been able to figure out how to do this yet.

5A5D6804-3D8F-4439-8D64-5B0BA7DAAA84

To reiterate: please implement independent control of the Darkness/Lightness of UI elements ("chrome") and the code editor, so that the UI elements are no longer forced to be dark when the code editor is set to dark. Since that was the previous behavior, this is really more of a regression report than a feature request.

@iron0012 iron0012 changed the title Allow the "light"/"dark" mode for GUI elements ("chrome") to be controlled independently of the Editor theme Allow the "light"/"dark" mode for GUI elements ("chrome") to be configured independently of the Editor theme Mar 8, 2022
@iron0012 iron0012 changed the title Allow the "light"/"dark" mode for GUI elements ("chrome") to be configured independently of the Editor theme Allow the "light"/"dark" mode for GUI elements to be configured independently of the Editor theme Mar 8, 2022
@ronblum
Copy link
Contributor

@ronblum ronblum commented Mar 10, 2022

@iron0012 Thank you for the suggestion! The intended behavior is that of the panes pick up the same theme, not for only some of the panes—Editor, Console, and Terminal—to have different themes from the rest. An egregious example is the Connections Pane, which has a mixture of both (see below). I'm marking this as an enhancement request, which we'll review as we continue development of RStudio.

mixed_theme

@jmcphers
Copy link
Member

@jmcphers jmcphers commented Apr 29, 2022

@sporella
Copy link

@sporella sporella commented Apr 29, 2022

I also prefer a light GUI and dark theme only in script and console. That can't be possible anymore without the "classic" Rstudio Theme option :(

I tried the same that @iron0012 , but it seems that all panels share the same css class.

rstudio

@pieterprovoost
Copy link

@pieterprovoost pieterprovoost commented Jun 4, 2022

@ronblum Would it be feasible to add some specific classes to Environment, Files, Packages, etc so they can be targeted individually in an rstheme?

@pieterprovoost
Copy link

@pieterprovoost pieterprovoost commented Jun 4, 2022

In case anyone is looking for a temporary fix, I get reasonable results with:

/* rs-theme-is-dark: FALSE */

.ace_editor, .rstudio-themes-flat.ace_editor_theme .profvis-flamegraph {
  background-color: #323232;
  color: #FFFFFF
}
.rstudio-themes-flat .ace_editor_theme, .rstudio-themes-flat.ace_editor_theme {
  background-color: #ffffff;
  color: black;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants