Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Improve admin spacing

Damian Legawiec3b97d7045d50
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_bulk-panel.css b/spree/admin/app/assets/tailwind/spree/admin/components/_bulk-panel.css
index 93737336ae..56106bec9c 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/components/_bulk-panel.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_bulk-panel.css
@@ -66,7 +66,7 @@
}
.bulk-panel-container .btn-close {
- @apply w-10;
+ @apply w-10 rounded-xl;
}
#bulk-panel {
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_cards.css b/spree/admin/app/assets/tailwind/spree/admin/components/_cards.css
index 17f3dac9c8..9b86995fe0 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/components/_cards.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_cards.css
@@ -13,10 +13,6 @@
@apply p-0 mb-3;
}
- .card .card {
- @apply rounded-xl;
- }
-
/* Card with table */
.card > .table,
.card .table-responsive > .table {
@@ -74,7 +70,7 @@
}
.card-body {
- @apply flex-auto p-5;
+ @apply flex-auto p-3;
}
.card-body .form-group:last-child {
@@ -87,7 +83,7 @@
}
.card-header {
- @apply flex items-center mb-0 p-5 pr-3 h-14 border-b border-gray-100 rounded-t-[calc(var(--radius-xl)-1px)];
+ @apply flex items-center mb-0 px-3 h-12 border-b border-gray-100 rounded-t-[calc(var(--radius-xl)-1px)];
}
.card-header .card-title {
@@ -107,7 +103,7 @@
}
.card-footer {
- @apply p-5;
+ @apply p-3;
}
.card-footer:last-child {
diff --git a/spree/admin/app/assets/tailwind/spree/admin/components/_list-groups.css b/spree/admin/app/assets/tailwind/spree/admin/components/_list-groups.css
index 743dc321e7..c09e8ffab7 100644
--- a/spree/admin/app/assets/tailwind/spree/admin/components/_list-groups.css
+++ b/spree/admin/app/assets/tailwind/spree/admin/components/_list-groups.css
@@ -8,7 +8,7 @@
}
.list-group-item {
- @apply relative block py-3 px-5 text-gray-950 no-underline border border-gray-200 hover:bg-gray-25;
+ @apply relative block py-2.5 px-3 text-gray-950 no-underline border border-gray-200 hover:bg-gray-25;
}
.list-group-item:first-child {
diff --git a/spree/admin/app/helpers/spree/admin/table_helper.rb b/spree/admin/app/helpers/spree/admin/table_helper.rb
index 529692b71c..63f92085c3 100644
--- a/spree/admin/app/helpers/spree/admin/table_helper.rb
+++ b/spree/admin/app/helpers/spree/admin/table_helper.rb
@@ -359,7 +359,7 @@ module Spree
private
def sort_dropdown_toggle(current_direction, current_label)
- dropdown_toggle(class: 'btn-light btn-sm h-[2.125rem]') do
+ dropdown_toggle(class: 'btn-light btn-sm') do
safe_join([
icon(current_direction == 'asc' ? 'sort-ascending' : 'sort-descending'),
content_tag(:span, current_label),
diff --git a/spree/admin/app/models/spree/admin/form_builder.rb b/spree/admin/app/models/spree/admin/form_builder.rb
index 7be7b48c76..4f4514b2a9 100644
--- a/spree/admin/app/models/spree/admin/form_builder.rb
+++ b/spree/admin/app/models/spree/admin/form_builder.rb
@@ -389,7 +389,7 @@ module Spree
@template.content_tag(:div, class: 'input-group') do
prepend_html = if prepend.present?
- @template.content_tag(:div, prepend, class: 'pl-3 text-gray-400')
+ @template.content_tag(:div, prepend, class: 'pl-2 text-gray-400')
else
''.html_safe
end
diff --git a/spree/admin/app/views/spree/admin/orders/_shipment.html.erb b/spree/admin/app/views/spree/admin/orders/_shipment.html.erb
index 9346cd61cb..4b9a64df29 100644
--- a/spree/admin/app/views/spree/admin/orders/_shipment.html.erb
+++ b/spree/admin/app/views/spree/admin/orders/_shipment.html.erb
@@ -1,5 +1,5 @@
<% order ||= shipment.order %>
-<%= turbo_frame_tag dom_id(shipment), class: "card rounded-lg" do %>
+<%= turbo_frame_tag dom_id(shipment), class: "card" do %>
<div class="card-header items-center justify-between">
<div class="flex items-center gap-2">
<span class="flex items-center"><%= shipment_state(shipment.state) %></span>
diff --git a/spree/admin/app/views/spree/admin/payments/_payment.html.erb b/spree/admin/app/views/spree/admin/payments/_payment.html.erb
index 1ed50a8bb6..d098050896 100644
--- a/spree/admin/app/views/spree/admin/payments/_payment.html.erb
+++ b/spree/admin/app/views/spree/admin/payments/_payment.html.erb
@@ -1,4 +1,4 @@
-<div class="card rounded-lg" id="<%= dom_id(payment) %>">
+<div class="card" id="<%= dom_id(payment) %>">
<div class="card-header flex items-center gap-2">
<span class="badge badge-<%= payment.state %> gap-1">
<% if payment.completed? %>
diff --git a/spree/admin/app/views/spree/admin/payments/new.html.erb b/spree/admin/app/views/spree/admin/payments/new.html.erb
index bbfb95fc5a..ea97631a44 100644
--- a/spree/admin/app/views/spree/admin/payments/new.html.erb
+++ b/spree/admin/app/views/spree/admin/payments/new.html.erb
@@ -19,7 +19,7 @@
<ul class="list-group mb-6">
<% @payment_methods.each do |payment_method| %>
<li class="list-group-item p-0 overflow-hidden">
- <%= link_to spree.new_admin_order_payment_path(@order, payment_method_id: payment_method.id), class: "form-check-label flex items-center gap-4 px-6 py-6 w-full cursor-pointer hover:bg-gray-25 text-gray-900 no-underline" do %>
+ <%= link_to spree.new_admin_order_payment_path(@order, payment_method_id: payment_method.id), class: "form-check-label flex items-center gap-4 px-3 py-3 w-full cursor-pointer hover:bg-gray-25 text-gray-900 no-underline" do %>
<div class="form-check flex items-center">
<%= f.radio_button :payment_method_id, payment_method.id, class: "form-check-input" %>
</div>
diff --git a/spree/admin/app/views/spree/admin/payments/source_forms/_previous_cards.html.erb b/spree/admin/app/views/spree/admin/payments/source_forms/_previous_cards.html.erb
index bad482ee54..5e417790a1 100644
--- a/spree/admin/app/views/spree/admin/payments/source_forms/_previous_cards.html.erb
+++ b/spree/admin/app/views/spree/admin/payments/source_forms/_previous_cards.html.erb
@@ -3,7 +3,7 @@
<%= f.fields_for :source, @payment.source do |source_form| %>
<% previous_cards.each do |card| %>
<li class="list-group-item p-0">
- <%= source_form.label :id, value: card.id, class: "form-check-label flex items-center gap-4 px-6 py-6 w-full cursor-pointer hover:bg-gray-25" do %>
+ <%= source_form.label :id, value: card.id, class: "form-check-label flex items-center gap-4 px-3 py-3 w-full cursor-pointer hover:bg-gray-25" do %>
<div class="form-check flex items-center">
<%= source_form.radio_button :id, card.id, class: "form-check-input" %>
</div>
diff --git a/spree/admin/app/views/spree/admin/payments/source_forms/_store_credit.html.erb b/spree/admin/app/views/spree/admin/payments/source_forms/_store_credit.html.erb
index 3b05b7b82e..13b9d64a44 100644
--- a/spree/admin/app/views/spree/admin/payments/source_forms/_store_credit.html.erb
+++ b/spree/admin/app/views/spree/admin/payments/source_forms/_store_credit.html.erb
@@ -3,7 +3,7 @@
<%= f.fields_for :source, @payment.source do |source_form| %>
<% @store_credits.each do |credit| %>
<li class="list-group-item p-0">
- <%= source_form.label :id, value: credit.id, class: "form-check-label flex items-center gap-4 px-6 py-6 w-full cursor-pointer hover:bg-gray-25" do %>
+ <%= source_form.label :id, value: credit.id, class: "form-check-label flex items-center gap-4 px-3 py-3 w-full cursor-pointer hover:bg-gray-25" do %>
<div class="form-check flex items-center">
<%= source_form.radio_button :id, credit.id, class: "form-check-input", checked: @payment.source.id == credit.id || @store_credits.first.id == credit.id %>
</div>
diff --git a/spree/admin/app/views/spree/admin/shared/_filters_search_bar.html.erb b/spree/admin/app/views/spree/admin/shared/_filters_search_bar.html.erb
index 8cd8886996..6964be64bd 100644
--- a/spree/admin/app/views/spree/admin/shared/_filters_search_bar.html.erb
+++ b/spree/admin/app/views/spree/admin/shared/_filters_search_bar.html.erb
@@ -2,7 +2,7 @@
<% badge_name ||= label %>
<% placeholder ||= [Spree.t(:search), controller_name.humanize.downcase].join(' ') %>
-<div class="form-input flex items-center py-0 focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-blue-500 grow max-lg:max-w-[300px] mr-auto h-[2.125rem] max-lg:mb-4 transition-all duration-100 ease-in-out" id="filters-search-bar">
+<div class="form-input flex items-center py-0 focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-blue-500 grow max-lg:max-w-[300px] mr-auto max-lg:mb-4 transition-all duration-100 ease-in-out" id="filters-search-bar">
<%= icon "search", class: "mr-4 text-gray-600" %>
<%= search_field_tag "q[#{param}]", params.dig(:q, param), class: "outline-none border-0 h-full focus:border-0 focus:ring-0 p-0 text-base w-full", placeholder: placeholder, data: { filters_target: :input, badge_name: badge_name } %>
</div>
diff --git a/spree/admin/app/views/spree/admin/shipments/edit.html.erb b/spree/admin/app/views/spree/admin/shipments/edit.html.erb
index 1807d48778..e629f85b3b 100644
--- a/spree/admin/app/views/spree/admin/shipments/edit.html.erb
+++ b/spree/admin/app/views/spree/admin/shipments/edit.html.erb
@@ -2,12 +2,12 @@
<%= form_with model: @shipment, url: spree.admin_order_shipment_path(@order, @shipment), class: "w-full flex justify-between items-center" do |f| %>
<div>
<%= f.select :selected_shipping_rate_id, options_for_select(@shipment.shipping_rates.map {|sr| ["#{sr.name} #{sr.display_price}", sr.id] }, @shipment.selected_shipping_rate_id),
- {}, class: 'form-select', autofocus: true %>
+ {}, class: 'form-select form-select-sm', autofocus: true %>
</div>
<div class="flex h-full items-center gap-2">
<% if can? :update, @shipment %>
- <%= turbo_save_button_tag Spree.t('actions.save'), data: { turbo_frame: :_top }, type: :submit, class: 'btn btn-primary' %>
- <%= link_to Spree.t('actions.discard'), spree.edit_admin_order_path(@order), class: "btn btn-light" %>
+ <%= turbo_save_button_tag Spree.t('actions.save'), data: { turbo_frame: :_top }, type: :submit, class: 'btn btn-sm btn-primary' %>
+ <%= link_to Spree.t('actions.discard'), spree.edit_admin_order_path(@order), class: "btn btn-sm btn-light" %>
<% end %>
</div>
<% end %>
@@ -16,12 +16,12 @@
<%= form_with model: @shipment, url: spree.admin_order_shipment_path(@order, @shipment), class: "w-full py-1 flex justify-between items-center" do |f| %>
<div class="flex items-center text-nowrap gap-x-3 items-center grow mr-3">
<%= f.label :tracking, Spree.t(:tracking_number), class: 'mb-0' %>
- <%= f.text_field :tracking, class: 'form-input', required: true, autofocus: true %>
+ <%= f.text_field :tracking, class: 'form-input form-input-sm', required: true, autofocus: true %>
</div>
<div class="flex h-full items-center gap-2">
<% if can? :update, @shipment %>
- <%= turbo_save_button_tag Spree.t('actions.save'), data: { turbo_frame: dom_id(@shipment) }, type: :submit, class: 'btn btn-primary' %>
- <%= link_to Spree.t('actions.discard'), spree.edit_admin_order_path(@order), class: "btn btn-light" %>
+ <%= turbo_save_button_tag Spree.t('actions.save'), data: { turbo_frame: dom_id(@shipment) }, type: :submit, class: 'btn btn-sm btn-primary' %>
+ <%= link_to Spree.t('actions.discard'), spree.edit_admin_order_path(@order), class: "btn btn-sm btn-light" %>
<% end %>
</div>
<% end %>
diff --git a/spree/admin/app/views/spree/admin/tables/_column_selector.html.erb b/spree/admin/app/views/spree/admin/tables/_column_selector.html.erb
index 821508a2f6..002f494af2 100644
--- a/spree/admin/app/views/spree/admin/tables/_column_selector.html.erb
+++ b/spree/admin/app/views/spree/admin/tables/_column_selector.html.erb
@@ -7,7 +7,7 @@
<%= hidden_field_tag :redirect_url, request.fullpath %>
<%= dropdown(portal: false) do %>
- <%= dropdown_toggle(class: 'btn-light btn-sm h-[2.125rem]') do %>
+ <%= dropdown_toggle(class: 'btn-light btn-sm') do %>
<%= icon 'columns-3' %>
<span><%= Spree.t('admin.tables.columns') %></span>
<%= icon 'chevron-down' %>
diff --git a/spree/admin/app/views/spree/admin/tables/_query_builder.html.erb b/spree/admin/app/views/spree/admin/tables/_query_builder.html.erb
index 04292ec31b..80875aaa65 100644
--- a/spree/admin/app/views/spree/admin/tables/_query_builder.html.erb
+++ b/spree/admin/app/views/spree/admin/tables/_query_builder.html.erb
@@ -6,7 +6,7 @@
<div data-controller="dialog" class="h-full">
<button type="button"
- class="btn btn-light btn-sm h-[2.125rem]"
+ class="btn btn-light btn-sm"
data-action="dialog#open">
<%= icon 'filter' %>
<span><%= Spree.t('admin.tables.filters') %></span>
diff --git a/spree/admin/app/views/spree/admin/tables/_table.html.erb b/spree/admin/app/views/spree/admin/tables/_table.html.erb
index adc006ac2f..7b13b73622 100644
--- a/spree/admin/app/views/spree/admin/tables/_table.html.erb
+++ b/spree/admin/app/views/spree/admin/tables/_table.html.erb
@@ -15,7 +15,7 @@
<div class="flex flex-col lg:flex-row gap-3 items-start lg:items-center justify-between">
<div class="flex gap-2 items-center flex-wrap">
<%= search_form_for @search, url: url_for, html: { data: { turbo_frame: frame_name, turbo_action: 'advance', controller: 'auto-submit search-clear', auto_submit_delay_value: 300 } } do |f| %>
- <div class="form-input flex items-center py-0 pr-1 focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-blue-500 lg:w-[300px] mr-auto h-[2.125rem] transition-all duration-100 ease-in-out">
+ <div class="form-input flex items-center py-0 pr-1 focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-blue-500 lg:w-[300px] mr-auto h-[2rem] transition-all duration-100 ease-in-out">
<%= icon "search", class: "mr-4 text-gray-600 shrink-0" %>
<%= search_field_tag "q[#{search_param}]",
params.dig(:q, search_param),
@@ -55,7 +55,7 @@
date_to_input_name: "q[#{date_range_param}_lt]",
date_from_value: params.dig(:q, :"#{date_range_param}_gt"),
date_to_value: params.dig(:q, :"#{date_range_param}_lt"),
- css_classes: "btn-light btn-sm dropdown-toggle h-[2.125rem]" %>
+ css_classes: "btn-light btn-sm" %>
<%# Preserve search and filter state when submitting date range %>
<% if params.dig(:q, search_param).present? %>
<%= hidden_field_tag "q[#{search_param}]", params.dig(:q, search_param) %>
diff --git a/spree/core/config/locales/en.yml b/spree/core/config/locales/en.yml
index 9689d5f15b..1705dd3b72 100644
--- a/spree/core/config/locales/en.yml
+++ b/spree/core/config/locales/en.yml
@@ -779,6 +779,7 @@ en:
approver: Approver
are_you_sure: Are you sure?
are_you_sure_delete: Are you sure you want to delete this record?
+ assets: Media
associated_adjustment_closed: The associated adjustment is closed, and will not be recalculated. Do you want to open it?
at_symbol: "@"
attachments: Attachments