Skip to content

Commit 64baf16

Browse files
Merge pull request #189 from CodeForPhilly/issue-186_form-styling
Issue-186: Form-JS Styling
2 parents dec4e64 + 438bac1 commit 64baf16

File tree

7 files changed

+19
-11
lines changed

7 files changed

+19
-11
lines changed

builder-frontend/src/components/homeScreen/eligibilityCheckList/EligibilityChecksList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const EligibilityChecksList = () => {
3737
>
3838
Create New Check
3939
</div>
40-
<div class="flex flex-wrap gap-4">
40+
<div class="grid gap-4 justify-items-center grid-cols-1 md:grid-cols-2 xl:grid-cols-3">
4141
<For each={checks()}>
4242
{(check) => (
4343
<CheckCard

builder-frontend/src/components/homeScreen/eligibilityCheckList/eligibilityCheckDetail/modals/ParameterModal.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const ParameterModal = (
3535
<label class="block font-bold mb-2">Key:</label>
3636
<input
3737
type="text"
38-
class="w-full border border-gray-300 rounded px-3 py-2"
38+
class="form-input w-full border border-gray-300 rounded px-3 py-2"
3939
value={newParam.key}
4040
onInput={(e) => setNewParam("key", e.currentTarget.value)}
4141
placeholder="Enter parameter key"
@@ -45,7 +45,7 @@ const ParameterModal = (
4545
<label class="block font-bold mb-2">Label:</label>
4646
<input
4747
type="text"
48-
class="w-full border border-gray-300 rounded px-3 py-2"
48+
class="form-input w-full border border-gray-300 rounded px-3 py-2"
4949
value={newParam.label}
5050
onInput={(e) => setNewParam("label", e.currentTarget.value)}
5151
placeholder="Enter parameter label"
@@ -54,7 +54,7 @@ const ParameterModal = (
5454
<div class="mb-4">
5555
<label class="block font-bold mb-2">Type:</label>
5656
<select
57-
class="w-full border border-gray-300 rounded px-3 py-2"
57+
class="form-input w-full border border-gray-300 rounded px-3 py-2"
5858
value={newParam.type}
5959
onChange={(e) => setNewParam("type", e.currentTarget.value as "string" | "number" | "boolean")}
6060
>
@@ -72,6 +72,7 @@ const ParameterModal = (
7272
name={`param-required`}
7373
checked={newParam.required === true}
7474
onInput={() => setNewParam("required", true)}
75+
class="form-radio"
7576
/>
7677
True
7778
</div>
@@ -81,6 +82,7 @@ const ParameterModal = (
8182
name={`param-required`}
8283
checked={newParam.required === false}
8384
onInput={() => setNewParam("required", false)}
85+
class="form-radio"
8486
/>
8587
False
8688
</div>

builder-frontend/src/components/homeScreen/eligibilityCheckList/modals/CheckModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const EditCheckModal = (
3434
<label class="block font-bold mb-2">Name:</label>
3535
<input
3636
type="text"
37-
class="w-full border border-gray-300 rounded px-3 py-2"
37+
class="form-input w-full border border-gray-300 rounded px-3 py-2"
3838
value={newCheck.name}
3939
onInput={(e) => setNewCheck("name", e.currentTarget.value)}
4040
placeholder="Enter check name"
@@ -44,7 +44,7 @@ const EditCheckModal = (
4444
<label class="block font-bold mb-2">Module:</label>
4545
<input
4646
type="text"
47-
class="w-full border border-gray-300 rounded px-3 py-2"
47+
class="form-input w-full border border-gray-300 rounded px-3 py-2"
4848
value={newCheck.module}
4949
onInput={(e) => setNewCheck("module", e.currentTarget.value)}
5050
placeholder="Enter check module"

builder-frontend/src/components/project/manageBenefits/configureBenefit/EligibilityCheckListView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ const EligibilityCheckRow = (
138138
<tr>
139139
<td class="eligibility-check-table-cell border-top">
140140
<input
141-
class="rounded-sm border-2 border-gray-400"
141+
class="form-checkbox rounded-sm"
142142
type="checkbox"
143143
checked={isCheckSelected()}
144144
onChange={() => onToggle(check)}

builder-frontend/src/components/project/manageBenefits/configureBenefit/modals/ConfigureCheckModal.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ const ParameterNumberInput = (
114114
onInput={(e) => {onParameterChange(Number(e.target.value))}}
115115
value={currentValue()}
116116
type="number"
117+
class="form-input"
117118
/>
118119
</div>
119120
);
@@ -135,6 +136,7 @@ const ParameterStringInput = (
135136
onInput={(e) => { onParameterChange(e.target.value); }}
136137
type="text"
137138
value={currentValue() ?? ""}
139+
class="form-input"
138140
/>
139141
</div>
140142
);
@@ -159,6 +161,7 @@ const ParameterBooleanInput = (
159161
name={`param-${parameter().key}`}
160162
checked={currentValue() === true}
161163
onInput={() => onParameterChange(true)}
164+
class="form-radio"
162165
/>
163166
True
164167
</div>
@@ -168,6 +171,7 @@ const ParameterBooleanInput = (
168171
name={`param-${parameter().key}`}
169172
checked={currentValue() === false}
170173
onInput={() => onParameterChange(false)}
174+
class="form-radio"
171175
/>
172176
False
173177
</div>

builder-frontend/src/index.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@import "tailwindcss";
2-
@plugin "@tailwindcss/forms";
3-
2+
@plugin "@tailwindcss/forms" {
3+
strategy: "class"; /* only generate form-* classes */
4+
}
45

56
@layer components {
67
.btn-default {

builder-frontend/tailwind.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ export default {
55
extend: {},
66
},
77
plugins: [
8-
require("@tailwindcss/forms")
8+
require('@tailwindcss/forms')({
9+
strategy: 'class', // only apply styles when using form-* classes
10+
}),
911
],
1012
}
11-

0 commit comments

Comments
 (0)