From 01847f5263919d1e486ed571a96e4aa761d1ec81 Mon Sep 17 00:00:00 2001 From: Josh Pigford Date: Thu, 10 Apr 2025 10:55:27 -0500 Subject: [PATCH] Initial rough pass on colors --- .cursor/rules/ui-ux-design-guidelines.mdc | 2 +- app/assets/tailwind/maybe-design-system.css | 54 +++++++++++++++++-- app/helpers/forms_helper.rb | 2 +- app/helpers/menus_helper.rb | 2 +- .../account/entries/_entry_group.html.erb | 2 +- app/views/account/entries/_loading.html.erb | 2 +- app/views/account/holdings/index.html.erb | 4 +- app/views/account/transactions/_form.html.erb | 2 +- .../account/transactions/bulk_edit.html.erb | 2 +- app/views/account/valuations/index.html.erb | 4 +- .../accounts/_account_sidebar_tabs.html.erb | 2 +- .../accounts/_accountable_group.html.erb | 6 +-- app/views/accounts/_summary_card.html.erb | 2 +- app/views/accounts/index/_account_groups.erb | 2 +- .../accounts/index/_manual_accounts.html.erb | 2 +- app/views/accounts/show/_activity.html.erb | 8 +-- app/views/accounts/show/_chart.html.erb | 2 +- app/views/accounts/show/_menu.html.erb | 2 +- app/views/accounts/show/_tab.html.erb | 2 +- .../_budget_category.html.erb | 2 +- app/views/budget_categories/index.html.erb | 2 +- app/views/budgets/_budget_categories.html.erb | 2 +- app/views/budgets/_picker.html.erb | 2 +- app/views/budgets/show.html.erb | 12 ++--- app/views/categories/_category.html.erb | 4 +- .../categories/_category_list_group.html.erb | 2 +- app/views/categories/_form.html.erb | 2 +- app/views/categories/_menu.html.erb | 2 +- app/views/categories/_ruler.html.erb | 2 +- app/views/categories/index.html.erb | 2 +- app/views/category/deletions/new.html.erb | 4 +- app/views/category/dropdowns/_row.html.erb | 2 +- app/views/category/dropdowns/show.html.erb | 2 +- app/views/chats/_ai_consent.html.erb | 8 +-- app/views/chats/_ai_greeting.html.erb | 2 +- app/views/chats/edit.html.erb | 2 +- app/views/chats/index.html.erb | 6 +-- app/views/import/cleans/show.html.erb | 12 ++--- app/views/import/confirms/_mappings.html.erb | 2 +- app/views/import/uploads/show.html.erb | 2 +- app/views/imports/_import.html.erb | 2 +- app/views/imports/_ready.html.erb | 4 +- app/views/imports/_table.html.erb | 2 +- app/views/imports/index.html.erb | 4 +- app/views/imports/new.html.erb | 2 +- app/views/invite_codes/index.html.erb | 2 +- app/views/layouts/application.html.erb | 6 +-- app/views/layouts/auth.html.erb | 2 +- app/views/layouts/settings.html.erb | 2 +- .../layouts/shared/_breadcrumbs.html.erb | 2 +- .../layouts/shared/_page_header.html.erb | 2 +- app/views/layouts/sidebar/_nav_item.html.erb | 4 +- app/views/merchants/_merchant.html.erb | 4 +- app/views/merchants/_ruler.html.erb | 2 +- app/views/merchants/index.html.erb | 4 +- app/views/messages/_chat_form.html.erb | 2 +- app/views/onboardings/preferences.html.erb | 2 +- app/views/onboardings/profile.html.erb | 4 +- app/views/pages/changelog.html.erb | 2 +- app/views/pages/dashboard.html.erb | 4 +- .../pages/dashboard/_balance_sheet.html.erb | 6 +-- app/views/pages/early_access.html.erb | 4 +- app/views/pages/feedback.html.erb | 2 +- app/views/plaid_items/_plaid_item.html.erb | 4 +- app/views/settings/_section.html.erb | 2 +- .../settings/_settings_nav_item.html.erb | 2 +- .../_settings_nav_link_large.html.erb | 2 +- app/views/settings/billings/show.html.erb | 2 +- app/views/settings/profiles/show.html.erb | 4 +- app/views/settings/securities/show.html.erb | 2 +- app/views/shared/_app_version.html.erb | 2 +- app/views/shared/_drawer.html.erb | 2 +- app/views/shared/_modal.html.erb | 2 +- app/views/shared/_notification.html.erb | 4 +- app/views/shared/_pagination.html.erb | 2 +- app/views/shared/_subscribe_modal.html.erb | 4 +- app/views/shared/_syncing_notice.html.erb | 2 +- app/views/tag/deletions/new.html.erb | 4 +- app/views/tags/_ruler.html.erb | 2 +- app/views/tags/_tag.html.erb | 4 +- app/views/tags/index.html.erb | 4 +- app/views/transactions/_summary.html.erb | 2 +- app/views/transactions/index.html.erb | 2 +- .../transactions/searches/_menu.html.erb | 4 +- app/views/transfers/_form.html.erb | 2 +- .../user_messages/_user_message.html.erb | 2 +- app/views/users/_user_menu.html.erb | 2 +- 87 files changed, 179 insertions(+), 135 deletions(-) diff --git a/.cursor/rules/ui-ux-design-guidelines.mdc b/.cursor/rules/ui-ux-design-guidelines.mdc index 430959d6..49bf9faf 100644 --- a/.cursor/rules/ui-ux-design-guidelines.mdc +++ b/.cursor/rules/ui-ux-design-guidelines.mdc @@ -15,7 +15,7 @@ The codebase uses TailwindCSS v4.x (the newest version) with a custom design sys - Always start by referencing [maybe-design-system.css](mdc:app/assets/tailwind/maybe-design-system.css) to see the base primitives, functional tokens, and component tokens we use in the codebase - Always prefer using the functional "tokens" defined in @maybe-design-system.css when possible. - - Example 1: use `text-primary` rather than `text-gray-900` + - Example 1: use `text-primary` rather than `text-primary` - Example 2: use `bg-container` rather than `bg-white` - Example 3: use `border border-primary` rather than `border border-gray-200` - Never create new styles in [maybe-design-system.css](mdc:app/assets/tailwind/maybe-design-system.css) or [application.css](mdc:app/assets/tailwind/application.css) without explicitly receiving permission to do so diff --git a/app/assets/tailwind/maybe-design-system.css b/app/assets/tailwind/maybe-design-system.css index 65772d05..49d7265b 100644 --- a/app/assets/tailwind/maybe-design-system.css +++ b/app/assets/tailwind/maybe-design-system.css @@ -275,46 +275,90 @@ @utility bg-surface { @apply bg-gray-50; + + @variant theme-dark { + @apply bg-black; + } } @utility bg-surface-hover { @apply bg-gray-100; + + @variant theme-dark { + @apply bg-gray-800; + } } @utility bg-surface-inset { @apply bg-gray-100; + + @variant theme-dark { + @apply bg-gray-900; + } } @utility bg-surface-inset-hover { @apply bg-gray-200; + + @variant theme-dark { + @apply bg-gray-800; + } } @utility bg-container { @apply bg-white; + + @variant theme-dark { + @apply bg-gray-900; + } } @utility bg-container-hover { @apply bg-gray-50; + + @variant theme-dark { + @apply bg-gray-800; + } } @utility bg-container-inset { @apply bg-gray-50; + + @variant theme-dark { + @apply bg-gray-800; + } } @utility bg-container-inset-hover { @apply bg-gray-100; + + @variant theme-dark { + @apply bg-gray-700; + } } @utility bg-inverse { @apply bg-gray-800; + + @variant theme-dark { + @apply bg-white; + } } @utility bg-inverse-hover { @apply bg-gray-700; + + @variant theme-dark { + @apply bg-gray-100; + } } @utility bg-overlay { - @apply bg-alpha-black-200; + background-color: rgba(var(--color-gray-100), 0.5); + + @variant theme-dark { + background-color: var(--color-alpha-black-900); + } } @utility border-primary { @@ -363,15 +407,15 @@ } .btn--secondary { - @apply bg-gray-50 hover:bg-gray-100 text-gray-900; + @apply bg-gray-50 hover:bg-gray-100 text-primary; } .btn--outline { - @apply border border-alpha-black-200 text-gray-900 hover:bg-gray-50 disabled:bg-gray-50 disabled:hover:bg-gray-50 disabled:text-gray-400; + @apply border border-alpha-black-200 text-primary hover:bg-gray-50 disabled:bg-gray-50 disabled:hover:bg-gray-50 disabled:text-gray-400; } .btn--ghost { - @apply border border-transparent text-gray-900 hover:bg-gray-100; + @apply border border-transparent text-primary hover:bg-surface-inset-hover; } .btn--destructive { @@ -421,7 +465,7 @@ } .form-field__radio { - @apply text-gray-900; + @apply text-primary; } .form-field__submit { diff --git a/app/helpers/forms_helper.rb b/app/helpers/forms_helper.rb index 55c8c74c..0f0c8f40 100644 --- a/app/helpers/forms_helper.rb +++ b/app/helpers/forms_helper.rb @@ -30,7 +30,7 @@ end private def radio_tab_contents(label:, icon:) - tag.div(class: "flex px-4 py-1 rounded-lg items-center space-x-2 justify-center text-subdued group-has-checked:bg-white group-has-checked:text-gray-800 group-has-checked:shadow-sm") do + tag.div(class: "flex px-4 py-1 rounded-lg items-center space-x-2 justify-center text-subdued group-has-checked:bg-container group-has-checked:text-gray-800 group-has-checked:shadow-sm") do concat lucide_icon(icon, class: "w-5 h-5") concat tag.span(label, class: "group-has-checked:font-semibold") end diff --git a/app/helpers/menus_helper.rb b/app/helpers/menus_helper.rb index f903d8ec..34134888 100644 --- a/app/helpers/menus_helper.rb +++ b/app/helpers/menus_helper.rb @@ -38,7 +38,7 @@ module MenusHelper end def contextual_menu_content(&block) - tag.div class: "min-w-[200px] p-1 z-50 shadow-border-xs bg-white rounded-lg hidden", + tag.div class: "min-w-[200px] p-1 z-50 shadow-border-xs bg-container rounded-lg hidden", data: { menu_target: "content" } do capture(&block) end diff --git a/app/views/account/entries/_entry_group.html.erb b/app/views/account/entries/_entry_group.html.erb index 7a08bcf7..20ed2e45 100644 --- a/app/views/account/entries/_entry_group.html.erb +++ b/app/views/account/entries/_entry_group.html.erb @@ -21,7 +21,7 @@ <% end %> -
+
<%= content %>
diff --git a/app/views/account/entries/_loading.html.erb b/app/views/account/entries/_loading.html.erb index e5496bb7..cb9276b5 100644 --- a/app/views/account/entries/_loading.html.erb +++ b/app/views/account/entries/_loading.html.erb @@ -1,4 +1,4 @@ -
+
<%= tag.p t(".loading"), class: "text-secondary animate-pulse text-sm" %>
diff --git a/app/views/account/holdings/index.html.erb b/app/views/account/holdings/index.html.erb index 6b80ab59..49e393d9 100644 --- a/app/views/account/holdings/index.html.erb +++ b/app/views/account/holdings/index.html.erb @@ -1,5 +1,5 @@ <%= turbo_frame_tag dom_id(@account, "holdings") do %> -
+
<%= tag.h2 t(".holdings"), class: "font-medium text-lg" %> <%= link_to new_account_trade_path(account_id: @account.id), @@ -20,7 +20,7 @@ <%= tag.p t(".return"), class: "col-span-2 justify-self-end" %>
-
+
<%= render "account/holdings/cash", account: @account %> <%= render "account/holdings/ruler" %> diff --git a/app/views/account/transactions/_form.html.erb b/app/views/account/transactions/_form.html.erb index 8ca19c39..fd8d404c 100644 --- a/app/views/account/transactions/_form.html.erb +++ b/app/views/account/transactions/_form.html.erb @@ -8,7 +8,7 @@
<%= radio_tab_tag form: f, name: :nature, value: :outflow, label: t(".expense"), icon: "minus-circle", checked: params[:nature] == "outflow" || params[:nature].nil? %> <%= radio_tab_tag form: f, name: :nature, value: :inflow, label: t(".income"), icon: "plus-circle", checked: params[:nature] == "inflow" %> - <%= link_to new_transfer_path, data: { turbo_frame: :modal }, class: "flex px-4 py-1 rounded-lg items-center space-x-2 justify-center text-subdued group-has-checked:bg-white group-has-checked:text-gray-800 group-has-checked:shadow-sm" do %> + <%= link_to new_transfer_path, data: { turbo_frame: :modal }, class: "flex px-4 py-1 rounded-lg items-center space-x-2 justify-center text-subdued group-has-checked:bg-container group-has-checked:text-gray-800 group-has-checked:shadow-sm" do %> <%= lucide_icon "arrow-right-left", class: "w-5 h-5" %> <%= tag.span t(".transfer") %> <% end %> diff --git a/app/views/account/transactions/bulk_edit.html.erb b/app/views/account/transactions/bulk_edit.html.erb index ed9a6194..c42faf50 100644 --- a/app/views/account/transactions/bulk_edit.html.erb +++ b/app/views/account/transactions/bulk_edit.html.erb @@ -1,7 +1,7 @@ <%= turbo_frame_tag "bulk_transaction_edit_drawer" do %> + class="bg-container shadow-border-xs rounded-2xl max-h-[calc(100vh-32px)] h-full max-w-[480px] w-full mt-4 mr-4 ml-auto"> <%= styled_form_with url: bulk_update_account_transactions_path, scope: "bulk_update", class: "h-full", data: { turbo_frame: "_top" } do |form| %>
diff --git a/app/views/account/valuations/index.html.erb b/app/views/account/valuations/index.html.erb index 0d859559..fd344c85 100644 --- a/app/views/account/valuations/index.html.erb +++ b/app/views/account/valuations/index.html.erb @@ -1,5 +1,5 @@ <%= turbo_frame_tag dom_id(@account, "valuations") do %> -
+
<%= tag.h2 t(".valuations"), class: "font-medium text-lg" %> <%= link_to new_account_valuation_path(@account), @@ -18,7 +18,7 @@ <%= tag.div class: "col-span-1" %>
-
+
<%= turbo_frame_tag dom_id(@account.entries.account_valuations.new) %> <% if @entries.any? %> diff --git a/app/views/accounts/_account_sidebar_tabs.html.erb b/app/views/accounts/_account_sidebar_tabs.html.erb index 764ca6af..49d6ebaf 100644 --- a/app/views/accounts/_account_sidebar_tabs.html.erb +++ b/app/views/accounts/_account_sidebar_tabs.html.erb @@ -24,7 +24,7 @@ class="space-y-3" data-controller="tabs" data-tabs-local-storage-key-value="account-sidebar-tabs" - data-tabs-active-class="bg-white shadow-sm text-primary" + data-tabs-active-class="bg-surface shadow-sm text-primary" data-tabs-inactive-class="text-secondary" data-tabs-default-tab-value="assets-tab">
diff --git a/app/views/accounts/_accountable_group.html.erb b/app/views/accounts/_accountable_group.html.erb index b240a557..b9676a9a 100644 --- a/app/views/accounts/_accountable_group.html.erb +++ b/app/views/accounts/_accountable_group.html.erb @@ -11,7 +11,7 @@ <%= turbo_frame_tag "#{account_group.key}_sparkline", src: accountable_sparkline_path(account_group.key), loading: "lazy" do %>
-
+
<% end %>
@@ -23,7 +23,7 @@ <%= render "accounts/logo", account: account, size: "sm", color: account_group.color %>
- <%= tag.p account.name, class: "text-sm font-medium mb-0.5 truncate" %> + <%= tag.p account.name, class: "text-sm text-primary font-medium mb-0.5 truncate" %> <%= tag.p account.subtype&.humanize.presence || account_group.name, class: "text-sm text-secondary truncate" %>
@@ -32,7 +32,7 @@ <%= turbo_frame_tag dom_id(account, :sparkline), src: sparkline_account_path(account), loading: "lazy" do %>
-
+
<% end %>
diff --git a/app/views/accounts/_summary_card.html.erb b/app/views/accounts/_summary_card.html.erb index 384c1c8e..fe327728 100644 --- a/app/views/accounts/_summary_card.html.erb +++ b/app/views/accounts/_summary_card.html.erb @@ -1,6 +1,6 @@ <%# locals: (title:, content:) %> -
+

<%= title %>

<%= content %> diff --git a/app/views/accounts/index/_account_groups.erb b/app/views/accounts/index/_account_groups.erb index a5665690..18119975 100644 --- a/app/views/accounts/index/_account_groups.erb +++ b/app/views/accounts/index/_account_groups.erb @@ -8,7 +8,7 @@

<%= accounts.count %>

<%= totals_by_currency(collection: accounts, money_method: :balance_money) %>

-
+
<% accounts.each do |account| %> <%= render account %> <% end %> diff --git a/app/views/accounts/index/_manual_accounts.html.erb b/app/views/accounts/index/_manual_accounts.html.erb index 9f3d34ed..b20c400e 100644 --- a/app/views/accounts/index/_manual_accounts.html.erb +++ b/app/views/accounts/index/_manual_accounts.html.erb @@ -1,6 +1,6 @@ <%# locals: (accounts:) %> -
+
<%= lucide_icon "chevron-right", class: "group-open:transform group-open:rotate-90 text-secondary w-5" %> diff --git a/app/views/accounts/show/_activity.html.erb b/app/views/accounts/show/_activity.html.erb index e882e4c6..f11602d5 100644 --- a/app/views/accounts/show/_activity.html.erb +++ b/app/views/accounts/show/_activity.html.erb @@ -1,7 +1,7 @@ <%# locals: (account:) %> <%= turbo_frame_tag dom_id(account, "entries") do %> -
+
<%= tag.h2 t(".title"), class: "font-medium text-lg" %> <% unless @account.plaid_account_id.present? %> @@ -10,7 +10,7 @@ <%= lucide_icon("plus", class: "w-4 h-4") %> <%= tag.span t(".new") %> -
-
+
">

Color

diff --git a/app/views/categories/_menu.html.erb b/app/views/categories/_menu.html.erb index ff098cb0..83532011 100644 --- a/app/views/categories/_menu.html.erb +++ b/app/views/categories/_menu.html.erb @@ -5,7 +5,7 @@ <%= render partial: "categories/badge", locals: { category: transaction.category } %>