From 5a9bac33bfe0f9836f83660c28bdbd80b6a34cf6 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Thu, 11 Apr 2024 15:52:44 +0300 Subject: [PATCH] Invert trace images in dark mode --- app/assets/stylesheets/common.scss | 8 ++++++++ app/views/traces/_trace.html.erb | 2 +- app/views/traces/edit.html.erb | 2 +- app/views/traces/show.html.erb | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index a1cae7a36..cd45d0381 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -1036,4 +1036,12 @@ div.secondary-actions { margin-bottom: -1px; } +/* Rules for traces */ + +@include color-mode(dark) { + img.trace_image { + filter: invert(1); + } +} + @import 'browse'; diff --git a/app/views/traces/_trace.html.erb b/app/views/traces/_trace.html.erb index 184570499..72794355b 100644 --- a/app/views/traces/_trace.html.erb +++ b/app/views/traces/_trace.html.erb @@ -2,7 +2,7 @@ <% if Settings.status != "gpx_offline" %> <% if trace.inserted %> - <%= link_to image_tag(trace_icon_path(trace.user, trace), :alt => ""), show_trace_path(trace.user, trace) %> + <%= link_to image_tag(trace_icon_path(trace.user, trace), :alt => "", :class => "trace_image"), show_trace_path(trace.user, trace) %> <% else %> <%= t ".pending" %> <% end %> diff --git a/app/views/traces/edit.html.erb b/app/views/traces/edit.html.erb index 809112d4b..2059178cf 100644 --- a/app/views/traces/edit.html.erb +++ b/app/views/traces/edit.html.erb @@ -2,7 +2,7 @@

<%= t ".heading", :name => @trace.name %>

<% end %> -<%= image_tag trace_picture_path(@trace.user, @trace) %> +<%= image_tag trace_picture_path(@trace.user, @trace), :class => "trace_image" %> <%= bootstrap_form_for @trace do |f| %> <%= f.text_field :name, :disabled => true %> diff --git a/app/views/traces/show.html.erb b/app/views/traces/show.html.erb index def928da5..51b21f982 100644 --- a/app/views/traces/show.html.erb +++ b/app/views/traces/show.html.erb @@ -4,7 +4,7 @@ <% if Settings.status != "gpx_offline" %> <% if @trace.inserted %> - <%= image_tag trace_picture_path(@trace.user, @trace) %> + <%= image_tag trace_picture_path(@trace.user, @trace), :class => "trace_image" %> <% else %> <%= t ".pending" %> <% end %> -- 2.39.5