diff --git a/pages/_includes/cards/form/layout.html b/pages/_includes/cards/form/layout.html new file mode 100644 index 000000000..51ba06422 --- /dev/null +++ b/pages/_includes/cards/form/layout.html @@ -0,0 +1,59 @@ +{% assign horizontal = include.horizontal | default: false %} +
+
+

{{ include.title | default: 'Basic form' }}

+
+
+
+
+ +
+ + We'll never share your email with anyone else. +
+
+ +
+ +
+ + + Your password must be 8-20 characters long, contain letters and numbers, and must not contain + spaces, special characters, or emoji. + +
+
+ +
+ +
+ +
+
+ +
+ +
+ + + +
+
+ + +
+
+
\ No newline at end of file diff --git a/pages/_includes/parts/form/select.html b/pages/_includes/parts/form/select.html index 4fbecb50e..6115d6cc8 100644 --- a/pages/_includes/parts/form/select.html +++ b/pages/_includes/parts/form/select.html @@ -1,9 +1,9 @@ {% assign options = include.options | default: "One,Two,Three" | split: "," %}
-
{{ include.label | default: 'Select' }}
- +
{{ include.label | default: 'Select' }}
+
diff --git a/pages/form-elements.html b/pages/form-elements.html index 5a394bfe1..1e206a8ed 100644 --- a/pages/form-elements.html +++ b/pages/form-elements.html @@ -40,4 +40,12 @@ menu: forms + +
+ {% include cards/form/layout.html %} +
+ +
+ {% include cards/form/layout.html horizontal=true title="Horizontal form" %} +
diff --git a/pages/tmp3.html b/pages/tmp3.html index dc2386690..80c1c28b8 100644 --- a/pages/tmp3.html +++ b/pages/tmp3.html @@ -2,200 +2,11 @@ ---
-
-
-
Basic form
-
-
-
We'll never share - your email with anyone else.
-
- Your password must be 8-20 characters long,contain letters and numbers, and must not contain - spaces, special characters, or emoji. -
-
-
-
-
-
-
+ {% include cards/form/layout.html %}
-
-
Horizontal form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Radios
-
-
- - Option one is this and that -
-
- Option two can be - something else -
-
-
-
-
-
Checkbox
-
-
-
-
-
-
-
+ {% include cards/form/layout.html horizontal=true title="Horizontal form" %}
- -
-
-
Column sizing
-
-
-
-
-
-
-
-
-
-
Inline form
-
-
-
-
-
- @ -
- -
-
-
-
-
-
-
-
- -
-
-
Billing form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
- -
-
-
Event form
-
-
-
-
-
-
-
-
-
-
- - -
-
- - -
-
- - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {% for person in site.data.people limit: 5 offset: 30 %} - {% include ui/avatar.html person=person element="a" %} - {% endfor %} -
- {% include ui/icon.html icon="plus" %} -
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file diff --git a/scss/ui/_forms.scss b/scss/ui/_forms.scss index 14e4b842a..a307c0dc2 100644 --- a/scss/ui/_forms.scss +++ b/scss/ui/_forms.scss @@ -26,14 +26,27 @@ Form label Form hint */ .form-hint { + display: block; font-size: $small-font-size; color: $text-muted; - margin: 0 0 .75rem; line-height: $line-height-sm; + &:last-child { + margin-bottom: 0; + } + + & + .form-control { + margin-top: .25rem; + } + .form-label + & { margin-top: -.5rem; } + + .form-control + &, + .form-select + & { + margin-top: .25rem; + } } /**