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

Add new Material and Ayu themes #49

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions R/create.R
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ rstheme <- function(
fn_args_not_theme <- grep("^theme_", names(formals()), value = TRUE)
fn_args_not_theme <- c(fn_args_not_theme, "...")
theme_variables <- call_values[setdiff(names(call_values), fn_args_not_theme)]
# force evaluatation of all theme_variables now
theme_variables <- lapply(theme_variables, eval, envir = new.env())

path_rel_theme <- function(path) {
if (!theme_as_sass || is.null(theme_path)) return(path)
Expand Down
91 changes: 91 additions & 0 deletions inst/templates/ayu-dark.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
rstheme(
"Ayu Dark",
theme_dark = TRUE,
theme_flat = TRUE,
theme_path = here::here("inst/templates/ayu-dark.scss"),
theme_apply = TRUE,
theme_as_sass = TRUE,
theme_palette = list(
base00 = "#0D1016",
base01 = "#0A0E14",
base02 = "#4D5566",
base03 = "#4D5566B3",
base04 = "#273747",
base05 = "#B3B1AD",
base06 = "#626A73",
base07 = "#4D556699",
base08 = "#c4c6d4",
yellow = "#FFEE99",
blue = "#59C2FF",
teal = "#95E6CB",
green = "#C2D94C",
orange01 = "#E6B450",
orange02 = "#FFB454",
orange03 = "#FF8F40",
orange04 = "#E6B673",
orange05 = "#F29668",
pink = "#F07178"
),
ui_background = "$base01",
ui_foreground = "$base05",
code_string = "$green",
code_function = "$orange02",
code_value = "$orange04",
code_comment = "$base06",
code_variable = "$blue",
code_message = "$teal",
code_reserved = "$orange03",
code_operator = "$orange01",
code_bracket = "$base05",
code_namespace = "$pink",
code_identifier = "$base05",
ui_rstudio_background = "$base00",
ui_rstudio_foreground = "$base02",
ui_rstudio_toolbar_foreground = "$base02",
ui_rstudio_tabs_active_background = "$base00",
ui_rstudio_tabs_active_foreground = "$base05",
ui_rstudio_tabs_inactive_background = "$base00",
ui_rstudio_job_progress_bar = "$teal",
ui_selection = "$base04",
ui_console_selection = "$base04",
ui_line_active = "$base00",
ui_line_active_selection = "$base03",
ui_margin_line = "$base03",
rmd_chunk_background = "$base00",
ui_cursor = "$orange01",
ui_gutter_foreground = "$base07",
ui_debug_background = "$base03",
rmd_chunk_header = "$yellow",
rmd_heading_foreground = "$pink",
rmd_href = "$pink",
ui_completions_background = "$base00",
ui_completions_border = "$base00",
ui_completions_foreground = "$base03",
ui_completions_selected_foreground = "$base00",
rstheme_command_palette(),
rstheme_large_tabs(),
rstheme_dialog_options(
selected_foreground = "$base08",
help_foreground = "$base08",
input_foreground = "$code_value",
input_background = "$base01",
select_foreground = "$base08",
select_background = "$base01",
button_hover_foreground = "$base08"
),
rstheme_rainbow_parentheses(
"$teal", "$pink", "$base05", "$yellow", "$blue", "$green"
),
'.rstudio-themes-flat .gwt-TabLayoutPanelTab-selected {
.gwt-TabLayoutPanelTabInner .rstheme_tabLayoutCenter {
box-shadow: 0 -2px 0 $teal inset;
border-radius: 0 !important;
}
}
',
'.rstudio-themes-dark .dataGridHeader, .rstudio-themes-dark tr[__gwt_header_row] > :-webkit-any(td, th), .rstudio-themes-dark .dataTables_info {
background-color: $base00 !important;
border-color: $base00 !important;
}
'
)
144 changes: 144 additions & 0 deletions inst/templates/ayu-dark.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/* rs-theme-name: Ayu Dark {rsthemes} */
/* rs-theme-is-dark: TRUE */
$base00: #0D1016;
$base01: #0A0E14;
$base02: #4D5566;
$base03: #4D5566B3;
$base04: #273747;
$base05: #B3B1AD;
$base06: #626A73;
$base07: #4D556699;
$base08: #c4c6d4;
$yellow: #FFEE99;
$blue: #59C2FF;
$teal: #95E6CB;
$green: #C2D94C;
$orange01: #E6B450;
$orange02: #FFB454;
$orange03: #FF8F40;
$orange04: #E6B673;
$orange05: #F29668;
$pink: #F07178;
$ui_background: $base01;
$ui_foreground: $base05;
$code_string: $green;
$code_function: $orange02;
$code_value: $orange04;
$code_variable: $blue;
$code_message: $teal;
$ui_rstudio_background: $base00;
$ui_rstudio_foreground: $base02;
$ui_rstudio_border: $ui_background;
$rmd_chunk_background: $base00;
$ui_rstudio_tabs_inactive_background: $base00;
$ui_rstudio_tabs_inactive_foreground: transparentize($ui_foreground, 0.4);
$ui_rstudio_tabs_inactive_hover_background: $ui_rstudio_tabs_inactive_background;
$ui_rstudio_tabs_active_background: $base00;
$ui_rstudio_tabs_active_foreground: $base05;
$ui_rstudio_toolbar_background: $ui_rstudio_tabs_active_background;
$ui_rstudio_toolbar_foreground: $base02;
$ui_rstudio_search: $ui_rstudio_toolbar_background;
$ui_rstudio_scrollbar_background: $ui_background;
$ui_rstudio_scrollbar_handle: $rmd_chunk_background;
$ui_cursor: $orange01;
$ui_cursor_normal_mode: $ui_cursor;
$ui_gutter_foreground: $base07;
$ui_gutter_background: $ui_background;
$ui_line_active: $base00;
$ui_selection: $base04;
$ui_line_active_selection: $base03;
$ui_line_active_gutter: $ui_background;
$ui_bracket: transparentize($ui_cursor, 0.6);
$ui_invisible: transparentize($ui_foreground, 0.7);
$ui_indent_guide: $ui_invisible;
$ui_margin_line: $base03;
$ui_debug_background: $base03;
$ui_fold_arrows_foreground: $ui_cursor;
$ui_fold_arrows_background: transparentize($ui_fold_arrows_foreground, 0.5);
$ui_line_find: $ui_selection;
$ui_console_selection: $base04;
$ui_completions_background: $base00;
$ui_completions_foreground: $base03;
$ui_completions_border: $base00;
$ui_completions_selected_background: $ui_line_active_selection;
$ui_completions_selected_foreground: $base00;
$ui_rstudio_job_progress_bar: $teal;
$code_comment: $base06;
$code_namespace_font_style: italic;
$code_reserved: $orange03;
$code_operator: $orange01;
$code_bracket: $base05;
$code_namespace: $pink;
$code_identifier: $base05;
$code_string_background: inherit;
$code_function_background: inherit;
$code_value_background: inherit;
$code_variable_background: inherit;
$code_message_background: inherit;
$code_comment_background: inherit;
$code_reserved_background: inherit;
$code_operator_background: inherit;
$code_bracket_background: inherit;
$code_namespace_background: inherit;
$code_identifier_background: inherit;
$code_other: $code_string;
$rmd_heading_weight: 600;
$rmd_heading_foreground: $pink;
$rmd_heading_background: $code_string_background;
$rmd_chunk_header: $yellow;
$rmd_chunk_header_background: $code_function_background;
$rmd_href: $pink;
$rmd_href_background: $code_reserved_background;
@import "rstudio/_rstudio-dark.scss";
@import "rstudio/_rstudio-dark-flatter.scss";
@import "rstudio/_terminal.scss";
.rstudio-themes-flat .gwt-TabLayoutPanelTab-selected {
.gwt-TabLayoutPanelTabInner .rstheme_tabLayoutCenter {
box-shadow: 0 -2px 0 $teal inset;
border-radius: 0 !important;
}
}

.rstudio-themes-dark .dataGridHeader, .rstudio-themes-dark tr[__gwt_header_row] > :-webkit-any(td, th), .rstudio-themes-dark .dataTables_info {
background-color: $base00 !important;
border-color: $base00 !important;
}

$ui_command_palette_background: $ui_background;
$ui_command_palette_search_background: $ui_command_palette_background;
$ui_command_palette_border: $ui_command_palette_background;
$ui_command_palette_item_background: $ui_command_palette_background;
$ui_command_palette_item_color: $ui_foreground;
$ui_command_palette_item_hover_background: if($ui_rstudio_is_dark, lighten($ui_command_palette_item_background, 5%), darken($ui_command_palette_item_background, 5%));
$ui_command_palette_item_selected_background: if($ui_rstudio_is_dark, lighten($ui_command_palette_item_background, 10%), darken($ui_command_palette_item_background, 10%));
$ui_rstudio_dialog_background: $ui_rstudio_background;
$ui_rstudio_dialog_foreground: $ui_rstudio_foreground;
$ui_rstudio_dialog_border: if($ui_rstudio_is_dark, lighten($ui_rstudio_dialog_background, 5%), darken($ui_rstudio_dialog_background, 5%));
$ui_rstudio_dialog_selected_background: $ui_rstudio_dialog_border;
$ui_rstudio_dialog_selected_foreground: $base08;
$ui_rstudio_dialog_heading_foreground: $code_function;
$ui_rstudio_dialog_help_foreground: $base08;
$ui_rstudio_dialog_button_foreground: $ui_rstudio_dialog_foreground;
$ui_rstudio_dialog_button_background: $ui_rstudio_dialog_background;
$ui_rstudio_dialog_button_border: $ui_rstudio_dialog_border;
$ui_rstudio_dialog_button_hover_foreground: $base08;
$ui_rstudio_dialog_button_hover_background: lighten($ui_rstudio_dialog_button_background, 10%);
$ui_rstudio_dialog_button_hover_border: $ui_rstudio_dialog_border;
$ui_rstudio_dialog_input_foreground: $code_value;
$ui_rstudio_dialog_input_background: $base01;
$ui_rstudio_dialog_input_border: $ui_rstudio_dialog_border;
$ui_rstudio_dialog_checkbox_foreground: $ui_rstudio_dialog_foreground;
$ui_rstudio_dialog_checkbox_background: lighten($ui_rstudio_dialog_background, 5%);
$ui_rstudio_dialog_select_background: $base01;
$ui_rstudio_dialog_select_foreground: $base08;
$ui_paren_0: $teal;
$ui_paren_1: $pink;
$ui_paren_2: $base05;
$ui_paren_3: $yellow;
$ui_paren_4: $blue;
$ui_paren_5: $green;
$ui_paren_6: violet;
@import "rstudio/_command-palette.scss";
@import "rstudio/_large-tabs.scss";
@import "rstudio/_dialog-options.scss";
@import "rstudio/_rainbow-parens.scss";
96 changes: 96 additions & 0 deletions inst/templates/ayu-light.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
rstheme(
"Ayu Light",
theme_dark = FALSE,
theme_flat = TRUE,
theme_path = here::here("inst/templates/ayu-light.scss"),
theme_apply = TRUE,
theme_as_sass = TRUE,
theme_palette = list(
base00 = "#FFFFFF",
base01 = "#FAFAFA",
base02 = "#8A9199",
base03 = "#8A919959",
base04 = "#D1E4F4",
base05 = "#575F66",
base06 = "#ABB0B6",
base07 = "#8A919966",
purple = "#9e75c7",
blue = "#399EE6",
teal = "#4CBF99",
green = "#86B300",
orange01 = "#FF9940",
orange02 = "#F2AE49",
orange03 = "#FA8D3E",
orange04 = "#E6BA7E",
orange05 = "#ED9366",
pink = "#F07171"
),
ui_background = "$base00",
ui_foreground = "$base05",
code_string = "$green",
code_function = "$orange02",
code_value = "$purple",
code_comment = "$base06",
code_variable = "$blue",
code_message = "$teal",
code_reserved = "$orange03",
code_operator = "$orange02",
code_bracket = "$base05",
code_namespace = "$pink",
code_identifier = "$base05",
ui_rstudio_background = "$base00",
ui_rstudio_foreground = "$base02",
ui_rstudio_toolbar_foreground = "$base02",
ui_rstudio_tabs_active_background = "$base00",
ui_rstudio_tabs_active_foreground = "$base05",
ui_rstudio_tabs_inactive_background = "$base00",
ui_rstudio_job_progress_bar = "$teal",
ui_selection = "$base04",
ui_console_selection = "$base04",
ui_line_active = "$base00",
ui_line_active_selection = "$base03",
ui_margin_line = "$base01",
rmd_chunk_background = "$base01",
ui_cursor = "$orange01",
ui_gutter_foreground = "$base07",
ui_debug_background = "$base03",
rmd_chunk_header = "$purple",
rmd_heading_foreground = "$green",
rmd_href = "$blue",
ui_completions_background = "$base00",
ui_completions_border = "$base00",
ui_completions_foreground = "$base05",
ui_completions_selected_foreground = "$base03",
rstheme_command_palette(),
rstheme_large_tabs(),
rstheme_dialog_options(
selected_foreground = "$base05",
help_foreground = "$base05",
input_foreground = "$code_value",
input_background = "$base01",
select_foreground = "$base06",
select_background = "$base01",
button_background = "$orange02",
button_foreground = "$base01",
button_hover_background = "$orange04",
button_hover_foreground = "$base00"
),
rstheme_rainbow_parentheses(
"$teal", "$pink", "$base05", "$purple", "$blue", "$green"
),
'.rstudio-themes-flat .gwt-TabLayoutPanelTab-selected {
.gwt-TabLayoutPanelTabInner .rstheme_tabLayoutCenter {
box-shadow: 0 -2px 0 $orange01 inset;
border-radius: 0 !important;
}
}
',
'.rstudio-themes-dark .dataGridHeader, .rstudio-themes-dark tr[__gwt_header_row] > :-webkit-any(td, th), .rstudio-themes-dark .dataTables_info {
background-color: $base00 !important;
border-color: $base00 !important;
}
'
)

# make_rsthemes()
# hotload_rstheme("inst/themes/ayu-light.rstheme")
Loading