Forms
Talk about fieldsets with and without legends, vis-à-vis screen readers. Thematically related, nested fieldsets supported but should be avoided if possible for easier accessibility.
Basic Label and Input Pairs
Apply the .form-basic class to a <form> tag to activate the custom styling seen below.
Technical Note: The responsive design of this form is an interaction of element width, min-width, max-width, and media queries. It attempts to handle both small screen sizes (i.e., mobile) and small container sizes (i.e., a narrow column in a desktop design). However, when placing a form in a narrow container, consider including the .form-compact class as well, to force the "mobile" layout at desktop screen size, maximizing the use of space. Labels will appear above inputs, and the .input container will always be 100% width instead of 72%.
Advanced Options
Nesting, Fancy Legends, label options, etc...
Label Alignment
Be careful with RWD! ...... Be careful when using forms in narrow containers......
Use the .label-align class to have label text align right, for closer proximity to their fields. They will still align left on smaller screen sizes, when inputs drop below their label.
Text Input
Text Input
Text Input
Text Input
Text Input
Use the .label-right class to swap the left and right positions of label and input pairs. Note: This layout should only be used with smaller inputs, like those shown below. Labels will not align left on smaller screen sizes, nor will inputs drop below them. The left-right relationship is maintained at all sizes.
Fieldset Legends
It is said that the first Fieldsets roamed the Earth before written history, protecting early human civilization and bringing health and good fortune to all whom they encountered... perhaps this is why their <legend> tags persist to this day.
Legends act as captions for a fieldset, helping to describe the thematic grouping of fields. In general, only one <legend> tag should appear in a <fieldset>. Multiple legends can be rendered. However, only the first will be treated as the primary caption.
When using legends, apply the .topline class to the <form> or individual <fieldset>, to match the <legend> border and solidify the visual relationship.
Basic Legend
Blue-Green Legend (.accent-blue-green.fill)
Blue Legend (.accent-blue.fill)
Purple Legend (.accent-purple.fill)
Gold Legend (.accent-gold.fill)
Green Legend (.accent-green.fill)
Red Legend (.accent-red.fill)
Fieldsets can be nested to create complex field groupings.
Nested Fieldset 1
Text Input
Text Input
Nested Fieldset 2
Text Input
Text Input
Fieldset Colors
Fieldsets can use the same .accent-* and .fill classes as legends and other containers (.panel, <section>, <aside>, etc...).
Blue-Green Legend (.accent-blue-green.fill)
Blue Legend (.accent-blue.fill)
Purple Legend (.accent-purple.fill)
Gold Legend (.accent-gold.fill)
Green Legend (.accent-green.fill)
Red Legend (.accent-red.fill)
Basic Legend
Colored fieldsets can be nested, but be mindful of color contrast. It is usually best to use a light touch. Consider base gray for the parent, and coloring only the border (no .fill class).
Nested Fieldset 1
Text Input
Text Input
Nested Fieldset 2
Text Input
Text Input
Buttons
Snazzy options and icons...