From dd02264c612dc062205181ec3996ec9e928ce1b4 Mon Sep 17 00:00:00 2001 From: Valimp <112864841+Valimp@users.noreply.github.com> Date: Thu, 19 Oct 2023 18:14:59 +0200 Subject: [PATCH] fix: more spacing in edit preferences form (#9097) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: more spacing in edit preferences form * fix: change added class name of the last commit * fix: unwrap toggle button and text in phone mode * fix: add margin bottom in rtl mode * fix: radio button responsiveness * fix: responsiveness changes about previous commit * fix: fix margin bug last commit * fix: refactor html * fix: fix additional CSS issues in preference panel * fix: fix lint issue --------- Co-authored-by: Raphaƫl Bournhonesque --- html/js/product-preferences.js | 18 ++++++------ scss/_off.scss | 52 ++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 9 deletions(-) diff --git a/html/js/product-preferences.js b/html/js/product-preferences.js index 7ce5720b1cb5f..f704d50891bdd 100644 --- a/html/js/product-preferences.js +++ b/html/js/product-preferences.js @@ -91,7 +91,7 @@ function generate_preferences_switch_button(preferences_text, checkbox_id) { checked = " checked"; } - var html = '
' + + var html = '
' + '
' + '' + '
' + @@ -210,9 +210,9 @@ function display_user_product_preferences(target_selected, target_selection_form $.each(attribute_group.attributes, function(key, attribute) { attribute_group_html += "
  • " + - "
    " + - "
    " + - "" + attribute.setting_name + "
    "; + "
    " + + "
    " + + "" + attribute.setting_name + "
    "; $.each(preferences, function(key, preference) { @@ -222,10 +222,10 @@ function display_user_product_preferences(target_selected, target_selection_form checked = ' checked'; } - attribute_group_html += "" + "" + - ""; + "
    "; }); if (attribute.description_short) { @@ -234,7 +234,7 @@ function display_user_product_preferences(target_selected, target_selection_form attribute_group_html += "
    "; - attribute_group_html += "
  • "; + attribute_group_html += "
    "; }); attribute_group_html += "
    "; @@ -244,7 +244,7 @@ function display_user_product_preferences(target_selected, target_selection_form $(target_selection_form).html( '
    ' - + '
    ' + + '' @@ -257,7 +257,7 @@ function display_user_product_preferences(target_selected, target_selection_form + attribute_groups_html.join( "" ) + '' + '

    ' - + '
    ' + + '

    ' diff --git a/scss/_off.scss b/scss/_off.scss index 0507c640d50db..02ede1c61751b 100644 --- a/scss/_off.scss +++ b/scss/_off.scss @@ -606,6 +606,53 @@ ul.pagination li a { } } +@media #{$small-only} { + .toggle_food_preferences { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + } +} + +.close_food_preferences { + margin-bottom: 1rem; +} +.fieldset_attribute_group { + display: flex; + flex-direction: column; +} +.attribute_img { + display: flex; + align-items: center; +} + +@media #{$small-only} { + .attribute_group { + .attribute_item:first-child label { + margin-top: 1rem; + } + .attribute_item label { + margin-top: 0; + } + } +} + +@media #{$medium-up} { + .attribute_group .attribute_item label { + margin-top: 0; + } +} + +@media #{$large-up} { + .attribute_group { + display: flex; + justify-content: start; + } + .attribute_group .attribute_item:first-child { + padding-left: 8rem; + } +} + html[dir="rtl"] { .tab-bar-section.middle { left: 0; @@ -615,6 +662,9 @@ html[dir="rtl"] { .edit_button { float: left; } + .close_food_preferences { + margin-bottom: 1rem; + } .delete_button { float: left; margin-right: unset; @@ -636,6 +686,8 @@ html[dir="rtl"] { } } + + .match_icons { height: 48px; margin-right: 4px;