Adjust alignment of "recommended" form badges

This commit is contained in:
Matt Jankowski 2024-09-28 16:29:38 -04:00
parent 9d664f87a0
commit dfa72c0086
2 changed files with 7 additions and 2 deletions

View File

@ -110,6 +110,12 @@ code {
color: $primary-text-color; color: $primary-text-color;
display: block; display: block;
width: auto; width: auto;
&.boolean {
width: 100%;
display: flex;
justify-content: space-between;
}
} }
.label_input, .label_input,
@ -141,7 +147,6 @@ code {
.overridden, .overridden,
.recommended, .recommended,
.not_recommended { .not_recommended {
position: absolute;
margin: 0 4px; margin: 0 4px;
margin-top: -2px; margin-top: -2px;
} }

View File

@ -15,7 +15,7 @@ module RecommendedComponent
return unless options[:recommended] return unless options[:recommended]
key = options[:recommended].is_a?(Symbol) ? options[:recommended] : :recommended key = options[:recommended].is_a?(Symbol) ? options[:recommended] : :recommended
options[:label_text] = ->(raw_label_text, _required_label_text, _label_present) { safe_join([raw_label_text, ' ', content_tag(:span, I18n.t(key, scope: 'simple_form'), class: key)]) } options[:label_text] = ->(raw_label_text, _required_label_text, _label_present) { safe_join([tag.span(raw_label_text), tag.span(I18n.t(key, scope: 'simple_form'), class: key)]) }
nil nil
end end