From c0bb7d8eadf4761838cafa84283cd5606fd7807d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Thu, 12 Oct 2023 10:58:53 +0200 Subject: [PATCH] Feat: Improve checkbox styles --- templates/forms.html.twig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/templates/forms.html.twig b/templates/forms.html.twig index ef817de..70b0981 100644 --- a/templates/forms.html.twig +++ b/templates/forms.html.twig @@ -68,11 +68,11 @@ {%- endblock textarea_widget -%} {%- block checkbox_widget -%} - {%- set attr = attr|merge({'class': (attr.class|default('') ~ ' h-4 w-4 rounded border-gray-300 text-primary')|trim }) -%} + {%- set attr = attr|merge({'class': (attr.class|default('') ~ ' h-4 w-4 rounded text-primary')|trim }) -%} {%- if errors|length -%} - {%- set attr = attr|merge({'class': attr.class|default('') ~ ' ring-red-500 focus:ring-red-500' }) -%} + {%- set attr = attr|merge({'class': attr.class|default('') ~ ' border-red-500 text-red-500 ring-red-500 focus:ring-red-500' }) -%} {% else %} - {%- set attr = attr|merge({'class': attr.class|default('') ~ ' focus:ring-primary' }) -%} + {%- set attr = attr|merge({'class': attr.class|default('') ~ ' border-gray-300 focus:ring-primary' }) -%} {%- endif -%} {%- if attr.disabled is defined and attr.disabled == true -%} {%- set attr = attr|merge({'class': attr.class|default('') ~ ' cursor-not-allowed' }) -%} @@ -85,10 +85,11 @@
{{ form_widget(form) }}
-
+
+ {{- form_errors(form) -}}
{% endblock %}