feat: Add table-divider class and use it in investments summary section (#1463)

* feat: Add table-divider class and use it in investments summary section

* fix: manage dark-theme variant

* feat: apply table-divider to other tables

* refactor: use rem instead of px for table-divider class
This commit is contained in:
Alessio Cappa
2026-04-13 23:29:41 +02:00
committed by GitHub
parent 5e368bc847
commit 943a4d007d
6 changed files with 28 additions and 6 deletions

View File

@@ -203,3 +203,25 @@
.turbo-progress-bar { .turbo-progress-bar {
margin-top: env(safe-area-inset-top); margin-top: env(safe-area-inset-top);
} }
.table-divider {
position: relative;
}
.table-divider::after {
content: "";
position: absolute;
left: 1rem;
right: 1rem;
bottom: 0;
height: 1px;
background-color: var(--color-alpha-black-100);
}
[data-theme="dark"] .table-divider::after {
background-color: var(--color-alpha-white-200);
}
.table-divider:last-child::after {
display: none;
}

View File

@@ -40,7 +40,7 @@
</thead> </thead>
<tbody class="font-medium text-sm"> <tbody class="font-medium text-sm">
<% holdings.each_with_index do |holding, idx| %> <% holdings.each_with_index do |holding, idx| %>
<tr class="<%= idx < holdings.size - 1 ? "border-b border-divider" : "" %>"> <tr class="<%= idx < holdings.size - 1 ? "table-divider" : "" %>">
<td class="p-4"> <td class="p-4">
<div class="flex items-center gap-3"> <div class="flex items-center gap-3">
<% if holding.security.logo_url.present? %> <% if holding.security.logo_url.present? %>

View File

@@ -4,7 +4,7 @@
show_border = local_assigns.fetch(:show_border, false) show_border = local_assigns.fetch(:show_border, false)
%> %>
<tr data-category="category-<%= item[:category_id] %>" class="text-secondary text-sm <%= show_border ? "border-b border-divider" : "" %>"> <tr data-category="category-<%= item[:category_id] %>" class="text-secondary text-sm <%= show_border ? "table-divider" : "" %>">
<td colspan="2" class="py-3 px-4 lg:px-6 <%= is_sub ? "pl-7 lg:pl-9" : "" %>"> <td colspan="2" class="py-3 px-4 lg:px-6 <%= is_sub ? "pl-7 lg:pl-9" : "" %>">
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<% if is_sub %> <% if is_sub %>

View File

@@ -72,7 +72,7 @@
</thead> </thead>
<tbody class="text-secondary text-sm"> <tbody class="text-secondary text-sm">
<% investment_metrics[:top_holdings].each_with_index do |holding, idx| %> <% investment_metrics[:top_holdings].each_with_index do |holding, idx| %>
<tr class="<%= idx < investment_metrics[:top_holdings].size - 1 ? "border-b border-divider" : "" %>"> <tr class="<%= idx < investment_metrics[:top_holdings].size - 1 ? "table-divider" : "" %>">
<td class="py-3 px-4 lg:px-6"> <td class="py-3 px-4 lg:px-6">
<div class="flex items-center gap-3"> <div class="flex items-center gap-3">
<% if (logo = holding.security.display_logo_url).present? %> <% if (logo = holding.security.display_logo_url).present? %>

View File

@@ -50,7 +50,7 @@
</thead> </thead>
<tbody> <tbody>
<% net_worth_metrics[:asset_groups].each_with_index do |group, idx| %> <% net_worth_metrics[:asset_groups].each_with_index do |group, idx| %>
<tr class="<%= idx < net_worth_metrics[:asset_groups].size - 1 ? "border-b border-divider" : "" %>"> <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-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-success privacy-sensitive"><%= group[:total].format %></td>
</tr> </tr>
@@ -77,7 +77,7 @@
</thead> </thead>
<tbody> <tbody>
<% net_worth_metrics[:liability_groups].each_with_index do |group, idx| %> <% net_worth_metrics[:liability_groups].each_with_index do |group, idx| %>
<tr class="<%= idx < net_worth_metrics[:liability_groups].size - 1 ? "border-b border-divider" : "" %>"> <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-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-destructive privacy-sensitive"><%= group[:total].format %></td>
</tr> </tr>

View File

@@ -21,7 +21,7 @@
</thead> </thead>
<tbody class="text-secondary text-sm"> <tbody class="text-secondary text-sm">
<% trends_data.each_with_index do |trend, idx| %> <% trends_data.each_with_index do |trend, idx| %>
<tr class="<%= idx < trends_data.size - 1 ? "border-b border-divider" : "" %>"> <tr class="<%= idx < trends_data.size - 1 ? "table-divider" : "" %>">
<td class="py-3 px-4 lg:px-6"> <td class="py-3 px-4 lg:px-6">
<span class="flex items-center gap-2 <%= trend[:is_current_month] ? "font-medium" : "" %>"> <span class="flex items-center gap-2 <%= trend[:is_current_month] ? "font-medium" : "" %>">
<%= trend[:month] %> <%= trend[:month] %>