+
+/*\
+|*|
+|*| Responsive form layout
+|*|
+\*/
+
+/*
+ *
+ * Within the form, fields can be placed in <div> elements with
+ * class "form-field". Each can also have an additional class of one
+ * of "small", "medium", or "large". These classes will be used to
+ * select either a 1- or 2-column layout for each row depending on the
+ * width of the screen.
+ *
+ * Expected layout is as follows:
+ *
+ * "large" rows: 1-column on all devices
+ *
+ * "medium" rows: 2-column on wide displays (laptop/desktop/tablet)
+ * 1-column on small display (phones)
+ *
+ * "small" rows: 2-column on all devices
+ *
+ * Finally, a class of either "left" or "right" will select which
+ * column the field should appear in for fields that end up in 2
+ * columns.
+ */
+form {
+ max-width: 100%;
+ display: grid;
+ grid-template-columns: 49% 49%;
+ grid-column-gap: 2%;
+}
+
+.form-field.small.left,.form-field.medium.left {
+ grid-column-start: 1;
+}
+
+.form-field.small.right,.form-field.medium.right {
+ grid-column-start: 2;
+}
+
+.form-field.large {
+ grid-column-start: 1;
+ grid-column-end: span 2;
+}
+
+/* For a narrow screen, use a single-column for medium form fields. */
+@media screen and (max-width: 600px) {
+ .form-field.medium.left,.form-field.medium.right {
+ grid-column-start: 1;
+ grid-column-end: span 2
+ }
+}