From 123adc6976374e6700b4e574d5ebb57a66ddec41 Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Sun, 29 Sep 2024 14:16:05 -0400 Subject: [PATCH] types column layout vs grid --- app/assets/stylesheets/base/variables.scss | 1 + .../stylesheets/pages/case_contacts_form.scss | 45 ++++++++++++------- app/views/case_contacts/form/details.html.erb | 6 +-- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/app/assets/stylesheets/base/variables.scss b/app/assets/stylesheets/base/variables.scss index 3aee370434..6d50c418cf 100644 --- a/app/assets/stylesheets/base/variables.scss +++ b/app/assets/stylesheets/base/variables.scss @@ -10,4 +10,5 @@ $sidebar-dark: #1A2142; --dark: #262d3f; --gray: #5d657b; --silver: #D9D9D9; + --inactive: #9AA4CA; } diff --git a/app/assets/stylesheets/pages/case_contacts_form.scss b/app/assets/stylesheets/pages/case_contacts_form.scss index 42ca026963..a131e1da86 100644 --- a/app/assets/stylesheets/pages/case_contacts_form.scss +++ b/app/assets/stylesheets/pages/case_contacts_form.scss @@ -1,41 +1,52 @@ @use "../base/breakpoints.scss" as screen-sizes; #case-contact-form { - #contact-form-types { - display: grid; - grid-template-columns: 1fr; - } + & #contact-form-types { + --group-width: 250px; - @media only screen and (min-width: screen-sizes.$small) { - #contact-form-types { - grid-template-columns: 1fr 1fr; - } - } + columns: var(--group-width); - @media only screen and (min-width: screen-sizes.$medium) { - #contact-form-types { - grid-template-columns: 1fr 1fr 1fr; + & fieldset { + display: inline-block; + width: var(--group-width); + padding: .25rem; + + & legend { + color: var(--inactive); + } + + & .form-check { + padding-left: .25rem; + + & input { + float: none; + } + + & label { + display: inline; + } + } } } - .input-group-text { + & .input-group-text { border-top-right-radius: 0; border-bottom-right-radius: 0; } - h2 { + & h2 { font-size: 28px; } - h3 { + & h3 { font-size: medium; } - legend { + & legend { font-size: medium; } - #contact-form-action-buttons { + & #contact-form-action-buttons { display: flex; justify-content: flex-end; gap: 10px; diff --git a/app/views/case_contacts/form/details.html.erb b/app/views/case_contacts/form/details.html.erb index ddecc92d14..a68aac8e54 100644 --- a/app/views/case_contacts/form/details.html.erb +++ b/app/views/case_contacts/form/details.html.erb @@ -66,12 +66,12 @@

Contact Type(s)*

<% @grouped_contact_types.each do |group_name, contact_types| %> -
+
<%= group_name %> <%= form.collection_check_boxes(:contact_type_ids, contact_types, :id, :name) do |b| %> -
+
<%= b.check_box(class: ["form-check-input", "contact-form-type-checkbox", "ms-1"]) %> - <%= b.label(class: "form-check-label ps-2") %> + <%= b.label(class: "form-check-label") %>
<% end %>