Editing the R studio theme in the cache.css theme file (ACE editor?)

In RStudio, I found cache.css files for different topics in Rstudio. These are text files with the following code:

.ace_editor { border: 2px solid rgb(159, 159, 159); } .ace_editor.ace_focus { border: 2px solid #327fbd; } .ace_gutter { background: #232323; color: #F8F8F8; } .ace_print_margin { width: 1px; background: #232323; } .ace_scroller { background-color: #141414; } .ace_text-layer { color: #F8F8F8; } .ace_cursor { border-left: 2px solid #A7A7A7; } .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #A7A7A7; } .ace_marker-layer .ace_selection { background: rgba(221, 240, 255, 0.20); } .multiselect .ace_selection.start { box-shadow: 0 0 3px 0px #141414; border-radius: 2px; } .ace_marker-layer .ace_step { background: rgb(102, 82, 0); } .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 255, 255, 0.25); } .ace_marker-layer .ace_active_line { background: rgba(255, 255, 255, 0.031); } .ace_gutter_active_line { background-color: rgba(255, 255, 255, 0.031); } .ace_marker-layer .ace_selected_word { border: 1px solid rgba(221, 240, 255, 0.20); } .ace_invisible { color: rgba(255, 255, 255, 0.25); } .ace_keyword, .ace_meta { color:#CDA869; } .ace_constant, .ace_constant.ace_other { color:#CF6A4C; } .ace_constant.ace_character, { color:#CF6A4C; } .ace_constant.ace_character.ace_escape, { color:#CF6A4C; } .ace_invalid.ace_illegal { color:#F8F8F8; background-color:rgba(86, 45, 86, 0.75); } .ace_invalid.ace_deprecated { text-decoration:underline; font-style:italic; color:#D2A8A1; } .ace_support { color:#9B859D; } .ace_support.ace_constant { color:#CF6A4C; } .ace_fold { background-color: #AC885B; border-color: #F8F8F8; } .ace_support.ace_function { color:#DAD085; } .ace_storage { color:#F9EE98; } .ace_variable { color:#AC885B; } .ace_string { color:#8F9D6A; } .ace_string.ace_regexp { color:#E9C062; } .ace_comment { fontSize:4pt;font-style:italic; color:#996633; } .ace_variable { color:#7587A6; } .ace_xml_pe { color:#494949; } .ace_meta.ace_tag { color:#AC885B; } .ace_entity.ace_name.ace_function { color:#AC885B; } .ace_markup.ace_underline { text-decoration:underline; } .ace_markup.ace_heading { color:#CF6A4C; } .ace_markup.ace_list { color:#F9EE98; } .ace_indent-guide { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERH5zzBz5sz/AA5EBAYqeZXWAAAAAElFTkSuQmCC) right repeat-y; } .nocolor.ace_editor .ace_line span {color:#CDA869 !important;} .ace_bracket {margin: 0 !important; border: 0 !important; background-color: rgba(255, 255, 255, 0.25);} .ace_marker-layer .ace_foreign_line {position: absolute; z-index: -1; background-color: rgb(65, 65, 65);} .ace_marker-layer .ace_find_line {position: absolute; z-index: -1; background-color: rgb(134, 134, 134);} .ace_marker-layer .ace_active_debug_line {position: absolute; z-index: -1; background-color: rgb(137, 121, 38);} .ace_console_error { background-color: rgb(65, 65, 65); } 

I am trying to edit in them and I could use some help. So far, I have been able to change the color of the "comments" by detecting and changing the color specified after the "ace.comment" command. But I would like to do something similar with things like background color, text color and command color in R, curly braces color, etc. Etc.

Is it possible? If so, what do I need to edit to accomplish this?

+1
source share
2 answers

Yes, it is really possible. (Remember to restart Rstudio after each change)

I have no experience with ACE, but it is not so difficult to get the value of different variables. For instance,

 .ace_constant.ace_numeric { color: #4ef971; } ... .ace_string { color: #6A8F9D; } ... .ace_keyword { color: #85cfda; } 

- these are, respectively, the colors of numerical objects, strings and keywords (built-in functions and console)

+1
source

I found that the default web inspector with RStudio makes editing difficult. For several days, I tried to get folded comments in order to have different font attributes based on sections.

I found that using ATOM was a lot easier (see screenshot below). As soon as I found out that each variable changed, I created comments in the css file to make it easier for me to edit the next time. In ATOM, you can see the color, which makes it easier to determine what a variable defines.

I'm not sure if this is optimal, but as far as I can. I don’t know why people don’t comment on the definitions of variables, especially since some of them are not intuitive.

CSS Editing in RStudio

0
source

Source: https://habr.com/ru/post/1259129/


All Articles