Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Required form label for horizontal forms #1161

Merged
merged 2 commits into from
Jul 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/pages/_includes/cards/form/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ <h3 class="card-title">{{ include.title | default: 'Basic form' }}</h3>
<div class="card-body">
<form>
<div class="form-group mb-3 {% if horizontal %}row{% endif %}">
<label class="form-label{% if horizontal %} col-3 col-form-label{% endif %}">Email address</label>
<label class="{% if horizontal %}col-3 col-form-label{% else %}form-label{% endif %} required">Email address</label>
<div {% if horizontal %}class="col"{% endif %}>
<input type="email" class="form-control" aria-describedby="emailHelp" placeholder="Enter email">
<small class="form-hint">We'll never share your email with anyone else.</small>
</div>
</div>

<div class="form-group mb-3 {% if horizontal %}row{% endif %}">
<label class="form-label{% if horizontal %} col-3 col-form-label{% endif %}">Password</label>
<label class="{% if horizontal %}col-3 col-form-label{% else %}form-label{% endif %} required">Password</label>
<div {% if horizontal %}class="col"{% endif %}>
<input type="password" class="form-control" placeholder="Password">
<small class="form-hint">
Expand All @@ -25,7 +25,7 @@ <h3 class="card-title">{{ include.title | default: 'Basic form' }}</h3>
</div>

<div class="form-group mb-3 {% if horizontal %}row{% endif %}">
<label class="form-label{% if horizontal %} col-3 col-form-label{% endif %}">Select</label>
<label class="{% if horizontal %}col-3 col-form-label{% else %}form-label{% endif %}">Select</label>
<div {% if horizontal %}class="col"{% endif %}>
<select class="form-select">
<option>Option 1</option>
Expand All @@ -49,7 +49,7 @@ <h3 class="card-title">{{ include.title | default: 'Basic form' }}</h3>
</div>

<div class="form-group {% if horizontal %}row{% else %}mb-3{% endif %}">
<label class="form-label{% if horizontal %} col-3 col-form-label pt-0{% endif %}">Checkboxes</label>
<label class="{% if horizontal %}col-3 col-form-label pt-0{% else %}form-label{% endif %}">Checkboxes</label>
<div {% if horizontal %}class="col"{% endif %}>
<label class="form-check">
<input class="form-check-input" type="checkbox" checked="">
Expand Down
1 change: 1 addition & 0 deletions src/scss/ui/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ textarea {
/**
Form label
*/
.col-form-label,
.form-label {
display: block;
font-weight: $font-weight-medium;
Expand Down