diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 813118fac..29bf4ac6e 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -168,6 +168,10 @@ $table-header: #ecf1f6; font-weight: bold; } + .radio { + @include radio-or-checkbox-and-label-alignment; + } + select { height: $input-height; } diff --git a/app/assets/stylesheets/admin/dashboard/actions/form.scss b/app/assets/stylesheets/admin/dashboard/actions/form.scss new file mode 100644 index 000000000..aac8f43a1 --- /dev/null +++ b/app/assets/stylesheets/admin/dashboard/actions/form.scss @@ -0,0 +1,11 @@ +.dashboard-action-form { + .collection-radio-buttons { + column-gap: $line-height; + display: flex; + flex-wrap: wrap; + } + + .radio-and-label { + @include radio-or-checkbox-and-label-alignment; + } +} diff --git a/app/assets/stylesheets/admin/legislation/draft_versions/form.scss b/app/assets/stylesheets/admin/legislation/draft_versions/form.scss index 2d8232782..7764ccbf7 100644 --- a/app/assets/stylesheets/admin/legislation/draft_versions/form.scss +++ b/app/assets/stylesheets/admin/legislation/draft_versions/form.scss @@ -85,4 +85,12 @@ } } } + + .radio-and-label { + @include radio-or-checkbox-and-label-alignment; + + span { + margin-left: 1ch; + } + } } diff --git a/app/assets/stylesheets/admin/locales/form.scss b/app/assets/stylesheets/admin/locales/form.scss index ec965cfd2..00eab79db 100644 --- a/app/assets/stylesheets/admin/locales/form.scss +++ b/app/assets/stylesheets/admin/locales/form.scss @@ -1,6 +1,6 @@ .admin .locales-form { label { - display: table; + @include radio-or-checkbox-and-label-alignment; } select { diff --git a/app/assets/stylesheets/admin/site_customization/pages/form.scss b/app/assets/stylesheets/admin/site_customization/pages/form.scss new file mode 100644 index 000000000..0788cd01d --- /dev/null +++ b/app/assets/stylesheets/admin/site_customization/pages/form.scss @@ -0,0 +1,5 @@ +.site-customization-pages-form { + .radio-and-label { + @include radio-or-checkbox-and-label-alignment; + } +} diff --git a/app/assets/stylesheets/admin/tenants/form.scss b/app/assets/stylesheets/admin/tenants/form.scss index eed01d51f..7b7f52025 100644 --- a/app/assets/stylesheets/admin/tenants/form.scss +++ b/app/assets/stylesheets/admin/tenants/form.scss @@ -5,7 +5,7 @@ } .radio-and-label { - display: flex; + @include radio-or-checkbox-and-label-alignment; margin-bottom: calc($line-height / 3); &:last-of-type { diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index c6ff179c9..b3eae06c4 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -909,7 +909,6 @@ form { } [type="radio"] { - height: $line-height !important; vertical-align: top; + label { diff --git a/app/assets/stylesheets/mixins/forms.scss b/app/assets/stylesheets/mixins/forms.scss index df105c36d..683d19783 100644 --- a/app/assets/stylesheets/mixins/forms.scss +++ b/app/assets/stylesheets/mixins/forms.scss @@ -199,3 +199,9 @@ text-transform: uppercase; } } + +@mixin radio-or-checkbox-and-label-alignment { + align-items: baseline; + display: flex; + max-width: max-content; +} diff --git a/app/components/admin/dashboard/actions/form_component.html.erb b/app/components/admin/dashboard/actions/form_component.html.erb index 67244e9ed..51eedf7c6 100644 --- a/app/components/admin/dashboard/actions/form_component.html.erb +++ b/app/components/admin/dashboard/actions/form_component.html.erb @@ -3,13 +3,15 @@ <%= render "shared/errors" %>
-
+
<%= attribute_name(:action_type) %> - <% ::Dashboard::Action.action_types.keys.each do |action_type_value| %> - - <%= f.radio_button :action_type, action_type_value %> - - <% end %> +
+ <% ::Dashboard::Action.action_types.keys.each do |action_type_value| %> + + <%= f.radio_button :action_type, action_type_value %> + + <% end %> +
diff --git a/app/components/admin/legislation/draft_versions/form_component.html.erb b/app/components/admin/legislation/draft_versions/form_component.html.erb index 6d468e6d5..8c928ba55 100644 --- a/app/components/admin/legislation/draft_versions/form_component.html.erb +++ b/app/components/admin/legislation/draft_versions/form_component.html.erb @@ -63,9 +63,10 @@
<%= attribute_name(:status) %> <% ::Legislation::DraftVersion::VALID_STATUSES.each do |status| %> - <%= f.radio_button :status, status %> - <%= t("admin.legislation.draft_versions.form.hints.status.#{status}") %> -
+ + <%= f.radio_button :status, status %> + <%= t("admin.legislation.draft_versions.form.hints.status.#{status}") %> + <% end %>
diff --git a/app/components/admin/site_customization/pages/form_component.html.erb b/app/components/admin/site_customization/pages/form_component.html.erb index 4f0f97466..141ed75b0 100644 --- a/app/components/admin/site_customization/pages/form_component.html.erb +++ b/app/components/admin/site_customization/pages/form_component.html.erb @@ -13,8 +13,9 @@
<%= attribute_name(:status) %> <% ::SiteCustomization::Page::VALID_STATUSES.each do |status| %> - <%= f.radio_button :status, status %> -
+ + <%= f.radio_button :status, status %> + <% end %>