summaryrefslogtreecommitdiff
path: root/app/views/layouts/_diffs_colors_css.haml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/layouts/_diffs_colors_css.haml')
-rw-r--r--app/views/layouts/_diffs_colors_css.haml20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/views/layouts/_diffs_colors_css.haml b/app/views/layouts/_diffs_colors_css.haml
new file mode 100644
index 00000000000..d2efa392bd9
--- /dev/null
+++ b/app/views/layouts/_diffs_colors_css.haml
@@ -0,0 +1,20 @@
+- deletion_color = local_assigns.fetch(:deletion, nil)
+- addition_color = local_assigns.fetch(:addition, nil)
+
+- if deletion_color.present? || request.path == profile_preferences_path
+ = stylesheet_link_tag_defer "highlight/diff_custom_colors_deletion"
+- if deletion_color.present?
+ - deletion_color_rgb = hex_color_to_rgb_array(deletion_color).join(',')
+ :css
+ :root {
+ --diff-deletion-color: rgba(#{deletion_color_rgb},0.2);
+ }
+
+- if addition_color.present? || request.path == profile_preferences_path
+ = stylesheet_link_tag_defer "highlight/diff_custom_colors_addition"
+- if addition_color.present?
+ - addition_color_rgb = hex_color_to_rgb_array(addition_color).join(',')
+ :css
+ :root {
+ --diff-addition-color: rgba(#{addition_color_rgb},0.2);
+ }