From 99da60921ffd688139018bde2035bfae811e0b9f Mon Sep 17 00:00:00 2001 From: David Cook Date: Fri, 8 Sep 2023 10:20:26 +1000 Subject: [PATCH 1/2] Fix Update button sizing This was broken when upgrading [Foundation](https://github.com/openfoodfoundation/openfoodnetwork/pull/11349). For some reason the button.expand class now sets larger font size and padding, which overrides the button.small class. It's probably a bug but we'll have to work around it. --- app/views/spree/orders/form/_cart_actions_row.html.haml | 6 ++++-- app/webpacker/css/darkswarm/cart-page.scss | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/spree/orders/form/_cart_actions_row.html.haml b/app/views/spree/orders/form/_cart_actions_row.html.haml index f03359f57d..a7927ffc9b 100644 --- a/app/views/spree/orders/form/_cart_actions_row.html.haml +++ b/app/views/spree/orders/form/_cart_actions_row.html.haml @@ -1,8 +1,10 @@ %tr %td{colspan:"2"} %td - %button#update-button.secondary.radius.expand.small{"ng-class" => "{ alert: form.$dirty && form.$valid }"} - %i.ofn-i_023-refresh + %button#update-button.secondary.radius.small{"ng-class" => "{ alert: form.$dirty && form.$valid }"}< + =# Trimmed whitespace (angle brackets) to ensure first word doesn't wrap after icon + %i.ofn-i_023-refresh> +   = t(:orders_form_update_cart) %td %td#empty-cart.text-center diff --git a/app/webpacker/css/darkswarm/cart-page.scss b/app/webpacker/css/darkswarm/cart-page.scss index 52a8949e94..8374a60ae5 100644 --- a/app/webpacker/css/darkswarm/cart-page.scss +++ b/app/webpacker/css/darkswarm/cart-page.scss @@ -28,6 +28,7 @@ button, .button { margin: 0; + padding: 0.875rem; // Compact buttons inside table } .toggle-bought { From 2e6e083667a5beaa532961dc20a6e94f51dd1ffd Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 14 Sep 2023 09:37:10 +1000 Subject: [PATCH 2/2] [fixup] Fix Update button sizing By disabling line wrap we can consistently predict how it will appear. The longest translation we currently have is 14 characters so this should be fine. --- app/views/spree/orders/form/_cart_actions_row.html.haml | 6 ++---- app/webpacker/css/darkswarm/cart-page.scss | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/views/spree/orders/form/_cart_actions_row.html.haml b/app/views/spree/orders/form/_cart_actions_row.html.haml index a7927ffc9b..6180f60c80 100644 --- a/app/views/spree/orders/form/_cart_actions_row.html.haml +++ b/app/views/spree/orders/form/_cart_actions_row.html.haml @@ -1,10 +1,8 @@ %tr %td{colspan:"2"} %td - %button#update-button.secondary.radius.small{"ng-class" => "{ alert: form.$dirty && form.$valid }"}< - =# Trimmed whitespace (angle brackets) to ensure first word doesn't wrap after icon - %i.ofn-i_023-refresh> -   + %button#update-button.secondary.radius.small{"ng-class" => "{ alert: form.$dirty && form.$valid }"} + %i.ofn-i_023-refresh = t(:orders_form_update_cart) %td %td#empty-cart.text-center diff --git a/app/webpacker/css/darkswarm/cart-page.scss b/app/webpacker/css/darkswarm/cart-page.scss index 8374a60ae5..c63561930b 100644 --- a/app/webpacker/css/darkswarm/cart-page.scss +++ b/app/webpacker/css/darkswarm/cart-page.scss @@ -29,6 +29,7 @@ .button { margin: 0; padding: 0.875rem; // Compact buttons inside table + white-space: nowrap; } .toggle-bought {