Remove description from label

This commit is contained in:
Corinne Durrmeyer 2024-10-22 12:26:48 +02:00
parent 6e1a3b73ea
commit 6256b5f336
No known key found for this signature in database
GPG key ID: DDC049DDA35585B6
3 changed files with 19 additions and 7 deletions

View file

@ -218,15 +218,26 @@
}
}
.fr-label .fr-hint-text > *,
.fr-fieldset__legend .fr-hint-text > * {
.fr-label + .fr-hint-text > *,
.fr-fieldset__legend + .fr-hint-text > * {
// la description d'un champ peut contenir du markup (markdown->html),
// on herite donc la fontsize/mrgin/padding du fr-hint-text
// on herite donc la fontsize/margin/padding du fr-hint-text
font-size: inherit;
line-height: inherit;
margin: inherit;
padding: inherit;
}
.fr-label + .fr-hint-text {
// les messages d'aide se trouvant juste après un label prennent le même style que ceux se trouvant dans un label
margin-top: .25rem;
}
.fr-hint-text + .fr-input {
// les champs se trouvant juste après un message d'aide prennent le même syle que ceux se trouvant juste après un label
margin-top: .5rem;
}
input[type='password'],
select:not(.fr-select) {
display: block;

View file

@ -3,5 +3,9 @@
- if @champ.html_label?
= @form.label @champ.main_value_name, id: @champ.labelledby_id, for: @champ.input_id, class: 'fr-label' do
- render EditableChamp::ChampLabelContentComponent.new form: @form, champ: @champ, seen_at: @seen_at
- if @champ.description.present?
.fr-hint-text= render SimpleFormatComponent.new(@champ.description, allow_a: true)
- elsif @champ.legend_label?
%legend.fr-fieldset__legend.fr-text--regular{ id: @champ.labelledby_id }= render EditableChamp::ChampLabelContentComponent.new form: @form, champ: @champ, seen_at: @seen_at
%legend.fr-fieldset__legend.fr-text--regular.fr-pb-1w{ id: @champ.labelledby_id }= render EditableChamp::ChampLabelContentComponent.new form: @form, champ: @champ, seen_at: @seen_at
- if @champ.description.present?
.fr-hint-text{ id: @champ.describedby_id }= render SimpleFormatComponent.new(@champ.description, allow_a: true)

View file

@ -17,8 +17,5 @@
- if hint?
%span.fr-hint-text{ data: { controller: 'date-input-hint' } }= hint
- if @champ.description.present?
%span.fr-hint-text= render SimpleFormatComponent.new(@champ.description, allow_a: true)
- if @champ.textarea? && @champ.character_limit_base&.positive?
%span.fr-hint-text= t('.recommended_size', size: @champ.character_limit_base)