Skip to content

Make legend font-size the same as label font-size #208

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion crispy_bootstrap5/templates/bootstrap5/field.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% if field.label and not field|is_checkbox and form_show_labels %}
{% if field.use_fieldset %}<fieldset{% if 'form-horizontal' in form_class %} class="row"{% endif %}{% if field.aria_describedby %} aria-describedby="{{ field.aria_describedby }}"{% endif %}>{% endif %}
<{% if field.use_fieldset %}legend{% else %}label{% endif %}
{% if field.id_for_label %}for="{{ field.id_for_label }}"{% endif %} class="{% if 'form-horizontal' in form_class %}col-form-label pt-0{% else %}form-label{% endif %}{% if label_class %} {{ label_class }}{% endif %}{% if field.field.required %} requiredField{% endif %}">
{% if field.id_for_label %}for="{{ field.id_for_label }}"{% endif %} class="{% if 'form-horizontal' in form_class %}col-form-label pt-0{% else %}form-label{% endif %}{% if label_class %} {{ label_class }}{% endif %}{% if field.field.required %} requiredField{% endif %}{% if field.use_fieldset %} fs-6{% endif %}">
{{ field.label }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
</{% if field.use_fieldset %}legend{% else %}label{% endif %}>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{% if field.label %}
<fieldset{% if field.aria_describedby %} aria-describedby="{{ field.aria_describedby }}"{% endif %}{% if 'form-horizontal' in form_class %} class="row"{% endif %}>
<legend for="{{ field.id_for_label }}" class="{{ label_class }}{% if 'form-horizontal' in form_class %} col-form-label pt-0{% else %} form-label{% endif %}{% if field.field.required %} requiredField{% endif %}">
<legend for="{{ field.id_for_label }}" class="{{ label_class }} fs-6{% if 'form-horizontal' in form_class %} col-form-label pt-0{% else %} form-label{% endif %}{% if field.field.required %} requiredField{% endif %}">
{{ field.label }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
</legend>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{% if field.label %}
<fieldset{% if field.aria_describedby %} aria-describedby="{{ field.aria_describedby }}"{% endif %}{% if 'form-horizontal' in form_class %} class="row"{% endif %}>
<legend for="{{ field.id_for_label }}" class="{{ label_class }}{% if 'form-horizontal' in form_class %} col-form-label pt-0{% else %} form-label{% endif %}{% if field.field.required %} requiredField{% endif %}">
<legend for="{{ field.id_for_label }}" class="{{ label_class }} fs-6{% if 'form-horizontal' in form_class %} col-form-label pt-0{% else %} form-label{% endif %}{% if field.field.required %} requiredField{% endif %}">
{{ field.label }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
</legend>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion tests/results/checkboxes.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div class="mb-3" id="div_id_checkboxes">
<fieldset>
<legend class="form-label requiredField">Checkboxes<span class="asteriskField">*</span></legend>
<legend class="form-label fs-6 requiredField">Checkboxes<span class="asteriskField">*</span></legend>
<div>
<div class="form-check">
<input checked="checked" class="form-check-input" id="id_checkboxes_0" name="checkboxes" type="checkbox"
Expand Down
2 changes: 1 addition & 1 deletion tests/results/inline_checkboxes.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div id="div_id_checkboxes" class="mb-3">
<fieldset>
<legend for="" class=" form-label requiredField">Checkboxes<span class="asteriskField">*</span></legend>
<legend for="" class=" form-label fs-6 requiredField">Checkboxes<span class="asteriskField">*</span></legend>
<div>
<div class="form-check form-check-inline">
<input type="checkbox" class="form-check-input" name="checkboxes" value="1" id="id_checkboxes_0" checked>
Expand Down
2 changes: 1 addition & 1 deletion tests/results/inline_checkboxes_failing.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div id="div_id_checkboxes" class="mb-3">
<fieldset aria-describedby="id_checkboxes_error">
<legend for="" class=" form-label requiredField">Checkboxes<span class="asteriskField">*</span></legend>
<legend for="" class=" form-label fs-6 requiredField">Checkboxes<span class="asteriskField">*</span></legend>
<div>
<div class="form-check form-check-inline">
<input type="checkbox" class="form-check-input is-invalid" name="checkboxes" value="1" id="id_checkboxes_0" aria-invalid="true">
Expand Down
2 changes: 1 addition & 1 deletion tests/results/inline_checkboxes_failing_lt50.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div id="div_id_checkboxes" class="mb-3">
<fieldset>
<legend for="" class=" form-label requiredField">Checkboxes<span class="asteriskField">*</span></legend>
<legend for="" class=" form-label fs-6 requiredField">Checkboxes<span class="asteriskField">*</span></legend>
<div>
<div class="form-check form-check-inline">
<input type="checkbox" class="form-check-input is-invalid" name="checkboxes" value="1" id="id_checkboxes_0">
Expand Down
2 changes: 1 addition & 1 deletion tests/results/inline_checkboxes_failing_lt52.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div id="div_id_checkboxes" class="mb-3">
<fieldset>
<legend for="" class=" form-label requiredField">Checkboxes<span class="asteriskField">*</span></legend>
<legend for="" class=" form-label fs-6 requiredField">Checkboxes<span class="asteriskField">*</span></legend>
<div>
<div class="form-check form-check-inline">
<input type="checkbox" class="form-check-input is-invalid" name="checkboxes" value="1" id="id_checkboxes_0" aria-invalid="true">
Expand Down
2 changes: 1 addition & 1 deletion tests/results/inline_radios.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div id="div_id_inline_radios" class="mb-3">
<fieldset>
<legend for="" class=" form-label requiredField">Inline radios<span class="asteriskField">*</span></legend>
<legend for="" class=" form-label fs-6 requiredField">Inline radios<span class="asteriskField">*</span></legend>
<div>
<div class="form-check form-check-inline">
<input type="radio" class="form-check-input" name="inline_radios" value="option_one" id="id_inline_radios_0" required>
Expand Down
2 changes: 1 addition & 1 deletion tests/results/inline_radios_failing.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post" >
<div id="div_id_inline_radios" class="mb-3">
<fieldset aria-describedby="id_inline_radios_error">
<legend for="" class=" form-label requiredField">Inline radios<span class="asteriskField">*</span></legend>
<legend for="" class=" form-label fs-6 requiredField">Inline radios<span class="asteriskField">*</span></legend>
<div>
<div class="form-check form-check-inline">
<input type="radio" class="form-check-input is-invalid" name="inline_radios" value="option_one" id="id_inline_radios_0" required aria-invalid="true">
Expand Down
2 changes: 1 addition & 1 deletion tests/results/inline_radios_failing_lt50.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post" >
<div id="div_id_inline_radios" class="mb-3">
<fieldset>
<legend for="" class=" form-label requiredField">Inline radios<span class="asteriskField">*</span></legend>
<legend for="" class=" form-label fs-6 requiredField">Inline radios<span class="asteriskField">*</span></legend>
<div>
<div class="form-check form-check-inline">
<input type="radio" class="form-check-input is-invalid" name="inline_radios" value="option_one" id="id_inline_radios_0" required>
Expand Down
2 changes: 1 addition & 1 deletion tests/results/inline_radios_failing_lt52.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post" >
<div id="div_id_inline_radios" class="mb-3">
<fieldset>
<legend for="" class=" form-label requiredField">Inline radios<span class="asteriskField">*</span></legend>
<legend for="" class=" form-label fs-6 requiredField">Inline radios<span class="asteriskField">*</span></legend>
<div>
<div class="form-check form-check-inline">
<input type="radio" class="form-check-input is-invalid" name="inline_radios" value="option_one" id="id_inline_radios_0" required aria-invalid="true">
Expand Down
2 changes: 1 addition & 1 deletion tests/results/radio.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div id="div_id_radio" class="mb-3">
<fieldset>
<legend class="form-label requiredField"> Radio<span class="asteriskField">*</span></legend>
<legend class="form-label fs-6 requiredField"> Radio<span class="asteriskField">*</span></legend>
<div>
<div class="form-check">
<input
Expand Down
2 changes: 1 addition & 1 deletion tests/results/test_grouped_checkboxes.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div class="mb-3" id="div_id_checkbox_select_multiple">
<fieldset aria-describedby="id_checkbox_select_multiple_helptext">
<legend class="form-label requiredField">Checkbox select multiple<span class="asteriskField">*</span></legend>
<legend class="form-label fs-6 requiredField">Checkbox select multiple<span class="asteriskField">*</span></legend>
<div><strong>Audio</strong>
<div class="form-check"><input class="form-check-input" id="id_checkbox_select_multiple_0_0"
name="checkbox_select_multiple" type="checkbox" value="vinyl"><label class="form-check-label"
Expand Down
2 changes: 1 addition & 1 deletion tests/results/test_grouped_checkboxes_failing.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div class="mb-3" id="div_id_checkbox_select_multiple">
<fieldset aria-describedby="id_checkbox_select_multiple_helptext id_checkbox_select_multiple_error">
<legend class="form-label requiredField">Checkbox select multiple<span class="asteriskField">*</span></legend>
<legend class="form-label fs-6 requiredField">Checkbox select multiple<span class="asteriskField">*</span></legend>
<div><strong>Audio</strong>
<div class="form-check"><input aria-invalid="true" class="form-check-input is-invalid" id="id_checkbox_select_multiple_0_0"
name="checkbox_select_multiple" type="checkbox" value="vinyl"><label class="form-check-label"
Expand Down
2 changes: 1 addition & 1 deletion tests/results/test_grouped_checkboxes_failing_lt50.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div class="mb-3" id="div_id_checkbox_select_multiple">
<fieldset>
<legend class="form-label requiredField">Checkbox select multiple<span class="asteriskField">*</span></legend>
<legend class="form-label fs-6 requiredField">Checkbox select multiple<span class="asteriskField">*</span></legend>
<div><strong>Audio</strong>
<div class="form-check"><input class="form-check-input is-invalid" id="id_checkbox_select_multiple_0_0"
name="checkbox_select_multiple" type="checkbox" value="vinyl"><label class="form-check-label"
Expand Down
2 changes: 1 addition & 1 deletion tests/results/test_grouped_checkboxes_failing_lt52.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div class="mb-3" id="div_id_checkbox_select_multiple">
<fieldset>
<legend class="form-label requiredField">Checkbox select multiple<span class="asteriskField">*</span></legend>
<legend class="form-label fs-6 requiredField">Checkbox select multiple<span class="asteriskField">*</span></legend>
<div><strong>Audio</strong>
<div class="form-check"><input aria-invalid="true" class="form-check-input is-invalid" id="id_checkbox_select_multiple_0_0"
name="checkbox_select_multiple" type="checkbox" value="vinyl"><label class="form-check-label"
Expand Down
2 changes: 1 addition & 1 deletion tests/results/test_grouped_checkboxes_lt52.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div class="mb-3" id="div_id_checkbox_select_multiple">
<fieldset>
<legend class="form-label requiredField">Checkbox select multiple<span class="asteriskField">*</span></legend>
<legend class="form-label fs-6 requiredField">Checkbox select multiple<span class="asteriskField">*</span></legend>
<div><strong>Audio</strong>
<div class="form-check"><input class="form-check-input" id="id_checkbox_select_multiple_0_0"
name="checkbox_select_multiple" type="checkbox" value="vinyl"><label class="form-check-label"
Expand Down
2 changes: 1 addition & 1 deletion tests/results/test_grouped_radios.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div class="mb-3" id="div_id_radio">
<fieldset>
<legend class="form-label requiredField">Radio<span class="asteriskField">*</span></legend>
<legend class="form-label fs-6 requiredField">Radio<span class="asteriskField">*</span></legend>
<div><strong>Audio</strong>
<div class="form-check"><input class="form-check-input" id="id_radio_0_0" name="radio" required type="radio"
value="vinyl"><label class="form-check-label" for="id_radio_0_0">Vinyl</label></div>
Expand Down
2 changes: 1 addition & 1 deletion tests/results/test_grouped_radios_failing.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div class="mb-3" id="div_id_radio">
<fieldset aria-describedby="id_radio_error">
<legend class="form-label requiredField">Radio<span class="asteriskField">*</span></legend>
<legend class="form-label fs-6 requiredField">Radio<span class="asteriskField">*</span></legend>
<div><strong>Audio</strong>
<div class="form-check"><input aria-invalid="true" class="form-check-input is-invalid" id="id_radio_0_0"
name="radio" required type="radio" value="vinyl"><label class="form-check-label"
Expand Down
2 changes: 1 addition & 1 deletion tests/results/test_grouped_radios_failing_lt50.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div class="mb-3" id="div_id_radio">
<fieldset>
<legend class="form-label requiredField">Radio<span class="asteriskField">*</span></legend>
<legend class="form-label fs-6 requiredField">Radio<span class="asteriskField">*</span></legend>
<div><strong>Audio</strong>
<div class="form-check"><input class="form-check-input is-invalid" id="id_radio_0_0"
name="radio" required type="radio" value="vinyl"><label class="form-check-label"
Expand Down
2 changes: 1 addition & 1 deletion tests/results/test_grouped_radios_failing_lt52.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form method="post">
<div class="mb-3" id="div_id_radio">
<fieldset>
<legend class="form-label requiredField">Radio<span class="asteriskField">*</span></legend>
<legend class="form-label fs-6 requiredField">Radio<span class="asteriskField">*</span></legend>
<div><strong>Audio</strong>
<div class="form-check"><input aria-invalid="true" class="form-check-input is-invalid" id="id_radio_0_0"
name="radio" required type="radio" value="vinyl"><label class="form-check-label"
Expand Down