From d09d792a46d9f0a8f80bd22820bf34a1f07456dc Mon Sep 17 00:00:00 2001 From: mano-odoo Date: Thu, 12 Oct 2023 13:18:53 +0200 Subject: [PATCH] [FIX] website_sale: checkout accordion card styling The goal of this PR is to unify the styling of the accordion component with the bootstrap styling of a card. The layout of the accordion had to be adapted with an extra div to use the `accordion-item` as the `card-body`. This styling will allow better maintainability of the accordion which now visually act as a card component in > lg screens. This will be required to handle different background theme color. This PR also fixes wrong indentation in the SCSS. task-3556135 closes odoo/odoo#138522 Signed-off-by: Valentin Chevalier --- .../static/src/scss/website_sale.scss | 34 ++-- addons/website_sale/views/templates.xml | 168 +++++++++--------- 2 files changed, 107 insertions(+), 95 deletions(-) diff --git a/addons/website_sale/static/src/scss/website_sale.scss b/addons/website_sale/static/src/scss/website_sale.scss index 4a109f03777..bede6f8ad09 100644 --- a/addons/website_sale/static/src/scss/website_sale.scss +++ b/addons/website_sale/static/src/scss/website_sale.scss @@ -668,16 +668,16 @@ a.no-decoration { min-width: 3em; } -#cart_total { - @include media-breakpoint-down(lg) { - border-top: $border-width solid $border-color; - padding-top: map-get($spacers, 3); - } -} - .o_website_sale_checkout { - .o_total_border { + .o_total_card { + // The accordion have to mimick the styling of a card + background-color: $card-bg; border: $border-width solid $border-color; + border-radius: $card-border-radius; + + .accordion-item { + @include o-bg-color(rgba($card-bg, $o-card-body-bg-opacity)); + } // TODO VCR This value should adapt to the offsetHeight // of the header this is an arbitrary value as a temporary solution @@ -688,6 +688,19 @@ a.no-decoration { @include media-breakpoint-down(lg) { border: 0; + + .card-body, .accordion-item, .accordion-button { + border-radius: 0; + background-color: var(--o-cc1-bg) !important; + color: inherit; + } + } + } + + #cart_total { + @include media-breakpoint-down(lg) { + padding-top: map-get($spacers, 3); + border-top: $border-width solid $border-color; } } @@ -708,7 +721,6 @@ a.no-decoration { } } - span[itemprop='name'] { font-size: $h6-font-size; font-weight: $headings-font-weight; @@ -720,7 +732,6 @@ a.no-decoration { font-size: $font-size-sm; } - .o_wsale_address_fill { .col-form-label:not(.label-optional)::after { content: " *"; @@ -760,8 +771,7 @@ a.no-decoration { } } - - // TODO: This height is arbitrary and the calculation should be improved. + // TODO This height is arbitrary and the calculation should be improved. .o_cta_navigation_placeholder { height: o-to-rem(111px) + map-get($spacers, 4) + 2rem; } diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index 4462bea2a6a..3bf119e6638 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -2122,7 +2122,7 @@
-
@@ -2134,90 +2134,92 @@
-
-
- -
-
- Your cart is empty! -
- -
-
- - - - - - - - - - -
- - - - - - - -
- - - - - x - -
-
- - -
+
+
+
+
- - -