Skip to content

Commit 123adc6

Browse files
committed
types column layout vs grid
1 parent 74896cb commit 123adc6

File tree

3 files changed

+32
-20
lines changed

3 files changed

+32
-20
lines changed

app/assets/stylesheets/base/variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ $sidebar-dark: #1A2142;
1010
--dark: #262d3f;
1111
--gray: #5d657b;
1212
--silver: #D9D9D9;
13+
--inactive: #9AA4CA;
1314
}

app/assets/stylesheets/pages/case_contacts_form.scss

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,52 @@
11
@use "../base/breakpoints.scss" as screen-sizes;
22

33
#case-contact-form {
4-
#contact-form-types {
5-
display: grid;
6-
grid-template-columns: 1fr;
7-
}
4+
& #contact-form-types {
5+
--group-width: 250px;
86

9-
@media only screen and (min-width: screen-sizes.$small) {
10-
#contact-form-types {
11-
grid-template-columns: 1fr 1fr;
12-
}
13-
}
7+
columns: var(--group-width);
148

15-
@media only screen and (min-width: screen-sizes.$medium) {
16-
#contact-form-types {
17-
grid-template-columns: 1fr 1fr 1fr;
9+
& fieldset {
10+
display: inline-block;
11+
width: var(--group-width);
12+
padding: .25rem;
13+
14+
& legend {
15+
color: var(--inactive);
16+
}
17+
18+
& .form-check {
19+
padding-left: .25rem;
20+
21+
& input {
22+
float: none;
23+
}
24+
25+
& label {
26+
display: inline;
27+
}
28+
}
1829
}
1930
}
2031

21-
.input-group-text {
32+
& .input-group-text {
2233
border-top-right-radius: 0;
2334
border-bottom-right-radius: 0;
2435
}
2536

26-
h2 {
37+
& h2 {
2738
font-size: 28px;
2839
}
2940

30-
h3 {
41+
& h3 {
3142
font-size: medium;
3243
}
3344

34-
legend {
45+
& legend {
3546
font-size: medium;
3647
}
3748

38-
#contact-form-action-buttons {
49+
& #contact-form-action-buttons {
3950
display: flex;
4051
justify-content: flex-end;
4152
gap: 10px;

app/views/case_contacts/form/details.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@
6666
<h3>Contact Type(s)<span class="red-letter">*</span></h3>
6767
<div id="contact-form-types" class="mb-3">
6868
<% @grouped_contact_types.each do |group_name, contact_types| %>
69-
<fieldset class="form-group p-2">
69+
<fieldset class="form-group">
7070
<legend><%= group_name %></legend>
7171
<%= form.collection_check_boxes(:contact_type_ids, contact_types, :id, :name) do |b| %>
72-
<div class="form-check ps-1">
72+
<div class="form-check">
7373
<%= b.check_box(class: ["form-check-input", "contact-form-type-checkbox", "ms-1"]) %>
74-
<%= b.label(class: "form-check-label ps-2") %>
74+
<%= b.label(class: "form-check-label") %>
7575
</div>
7676
<% end %>
7777
</fieldset>

0 commit comments

Comments
 (0)