Skip to content

Commit d0e1e48

Browse files
authored
Merge pull request #762 from HelixDesignSystem/surf-173x-forms-layout
feat(forms): first rev
2 parents ac423a6 + 56df9b9 commit d0e1e48

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed

docs/_layout.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,15 @@ body.hxVertical {
9191
}
9292
}
9393
}
94+
95+
// ===== FORMS SUPPORT =====
96+
body.hxVertical.hxForm.beta,
97+
body.hxHorizontal.hxForm.beta {
98+
main#content > header {
99+
background-color: 1px solid $gray-50;
100+
border-color: $gray-100;
101+
border-style: solid;
102+
border-width: 0 0 1px;
103+
padding: $container-padding;
104+
}
105+
}

src/scss/_vars.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ $space: (
9797
flush: 0
9898
);
9999

100+
// ===== FORMS v1.0.0 SUPPORT =====
101+
$container-padding: 2rem;
102+
100103
// ---------------------------------------- //
101104
// ----------------- GRID ----------------- //
102105
// ---------------------------------------- //

src/scss/components/form/_index.scss

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,78 @@ $form-asterisk-offset: $form-asterisk-size + $form-asterisk-gap;
119119
}
120120
//end:COMPONENT
121121

122+
/// ---------- FORM LAYOUT ---------- ///
123+
124+
.hxForm.beta {
125+
> * {
126+
margin: 1rem 0; // FIXME: solve with spacing system
127+
128+
&:first-child {
129+
margin-top: 0; // FIXME: solve with spacing system
130+
}
131+
132+
&:last-child {
133+
margin-bottom: 0; // FIXME: solve with spacing system
134+
}
135+
}
136+
137+
fieldset {
138+
> * {
139+
margin: 0.25rem 0; // FIXME: solve with spacing system
140+
141+
&:first-child {
142+
margin-top: 0; // FIXME: solve with spacing system
143+
}
144+
145+
&:last-child {
146+
margin-bottom: 0; // FIXME: solve with spacing system
147+
}
148+
}
149+
150+
> legend {
151+
color: $gray-800;
152+
font-size: 0.875rem; // ~14px
153+
}
154+
155+
> label {
156+
display: block;
157+
font-size: 1rem; // NOTE: this may change with checkboxes and radios
158+
}
159+
}
160+
161+
select,
162+
input[type="range"] {
163+
display: block;
164+
width: 100%;
165+
}
166+
}
167+
168+
// ---------- PAGE FORM LAYOUT ---------- //
169+
form.hxForm.beta {
170+
> header {
171+
background-color: 1px solid $gray-50;
172+
border-color: $gray-100;
173+
border-style: solid;
174+
border-width: 0 0 1px;
175+
padding: $container-padding;
176+
border-bottom: 1px solid $gray-100;
177+
}
178+
179+
> section {
180+
> header {
181+
border-top: 1px solid;
182+
border-color: $gray-100;
183+
}
184+
}
185+
186+
> footer {
187+
background: transparent;
188+
border-top: 1px solid;
189+
border-color: $gray-100;
190+
}
191+
}
192+
//end:LAYOUT
193+
122194
/// ---------- FORM HELPERS ----------
123195
///
124196
/// Screen readers already announce if a field is required, but we need

0 commit comments

Comments
 (0)