Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

feat(ds): semantic color — neutralize decorative green/red on reports (#2134) (#2144)

Guillem Arias Fauste52b9b47f8c1a
diff --git a/app/views/pages/dashboard/_investment_summary.html.erb b/app/views/pages/dashboard/_investment_summary.html.erb
index 8509bfe084..b38c2f9019 100644
--- a/app/views/pages/dashboard/_investment_summary.html.erb
+++ b/app/views/pages/dashboard/_investment_summary.html.erb
@@ -97,7 +97,7 @@
</div>
<div>
<p class="text-xs text-secondary"><%= t(".contributions") %></p>
- <p class="font-medium text-green-600 privacy-sensitive"><%= format_money(totals.contributions) %></p>
+ <p class="font-medium text-primary privacy-sensitive"><%= format_money(totals.contributions) %></p>
</div>
</div>
<div class="flex items-center gap-2">
@@ -106,7 +106,7 @@
</div>
<div>
<p class="text-xs text-secondary"><%= t(".withdrawals") %></p>
- <p class="font-medium text-orange-600 privacy-sensitive"><%= format_money(totals.withdrawals) %></p>
+ <p class="font-medium text-primary privacy-sensitive"><%= format_money(totals.withdrawals) %></p>
</div>
</div>
<div class="flex items-center gap-2">
diff --git a/app/views/reports/_breakdown_table.html.erb b/app/views/reports/_breakdown_table.html.erb
index ff3141557f..95fbfab1bd 100644
--- a/app/views/reports/_breakdown_table.html.erb
+++ b/app/views/reports/_breakdown_table.html.erb
@@ -2,7 +2,7 @@
<%# Local variables: groups, total, type (:income or :expense), amount_sort_params, current_sort_by, current_sort_direction %>
<%
- color_class = type == :income ? "text-success" : "text-destructive"
+ color_class = type == :income ? "text-success" : "text-primary"
icon_name = type == :income ? "trending-up" : "trending-down"
title_key = type == :income ? "reports.transactions_breakdown.table.income" : "reports.transactions_breakdown.table.expense"
%>
diff --git a/app/views/reports/_net_worth.html.erb b/app/views/reports/_net_worth.html.erb
index 492d636b64..93f979983d 100644
--- a/app/views/reports/_net_worth.html.erb
+++ b/app/views/reports/_net_worth.html.erb
@@ -29,9 +29,9 @@
<div class="p-4 bg-surface-inset rounded-lg">
<p class="text-sm text-secondary mb-2"><%= t("reports.net_worth.assets_vs_liabilities") %></p>
<div class="flex items-baseline gap-2 flex-wrap">
- <span class="text-lg font-semibold text-success break-words privacy-sensitive"><%= net_worth_metrics[:total_assets].format %></span>
+ <span class="text-lg font-semibold text-primary break-words privacy-sensitive"><%= net_worth_metrics[:total_assets].format %></span>
<span class="text-xs text-subdued shrink-0">-</span>
- <span class="text-lg font-semibold text-destructive break-words privacy-sensitive"><%= net_worth_metrics[:total_liabilities].format %></span>
+ <span class="text-lg font-semibold text-primary break-words privacy-sensitive"><%= net_worth_metrics[:total_liabilities].format %></span>
</div>
</div>
</div>
@@ -52,7 +52,7 @@
<% net_worth_metrics[:asset_groups].each_with_index do |group, idx| %>
<tr class="<%= idx < net_worth_metrics[:asset_groups].size - 1 ? "table-divider" : "" %>">
<td class="py-3 px-4 lg:px-6 text-sm font-medium text-secondary"><%= group[:name] %></td>
- <td class="py-3 px-4 lg:px-6 text-sm font-medium text-right text-success privacy-sensitive"><%= group[:total].format %></td>
+ <td class="py-3 px-4 lg:px-6 text-sm font-medium text-right text-primary privacy-sensitive"><%= group[:total].format %></td>
</tr>
<% end %>
<% if net_worth_metrics[:asset_groups].empty? %>
@@ -79,7 +79,7 @@
<% net_worth_metrics[:liability_groups].each_with_index do |group, idx| %>
<tr class="<%= idx < net_worth_metrics[:liability_groups].size - 1 ? "table-divider" : "" %>">
<td class="py-3 px-4 lg:px-6 text-sm font-medium text-secondary"><%= group[:name] %></td>
- <td class="py-3 px-4 lg:px-6 text-sm font-medium text-right text-destructive privacy-sensitive"><%= group[:total].format %></td>
+ <td class="py-3 px-4 lg:px-6 text-sm font-medium text-right text-primary privacy-sensitive"><%= group[:total].format %></td>
</tr>
<% end %>
<% if net_worth_metrics[:liability_groups].empty? %>
diff --git a/app/views/reports/_trends_insights.html.erb b/app/views/reports/_trends_insights.html.erb
index f3106ea604..c74ab704f0 100644
--- a/app/views/reports/_trends_insights.html.erb
+++ b/app/views/reports/_trends_insights.html.erb
@@ -66,7 +66,7 @@
<div class="p-4 bg-surface-inset rounded-lg">
<p class="text-sm text-secondary mb-1"><%= t("reports.trends.avg_monthly_expenses") %></p>
- <p class="text-lg font-semibold text-destructive privacy-sensitive">
+ <p class="text-lg font-semibold text-primary privacy-sensitive">
<%= Money.new(avg_expenses, Current.family.currency).format %>
</p>
</div>