Skip to content

Commit c3a3b19

Browse files
committed
add success class to checkbox input toggle
1 parent bc191c9 commit c3a3b19

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

django_daisy/static/admin/css/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

django_daisy/templates/django/forms/widgets/checkbox.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
value="{{ widget.value|stringformat:'s' }}"{% endif %}{% include "django/forms/widgets/attrs.html" %} >
66
{% endwith %}
77
{% else %}
8-
<label class="toggle toggle-sm toggle-primary checked:border-success checked:bg-success text-base-content">
9-
<input type="{{ widget.type }}" name="{{ widget.name }}" {% if widget.value != None %}
10-
value="{{ widget.value|stringformat:'s' }}"{% endif %}{% include "django/forms/widgets/attrs.html" %} >
11-
<svg
8+
<label class="text-base-content toggle toggle-sm">
9+
{% with widget=widget|apply_class_to_widget:'' %}
10+
<input class="toggle-primary" type="{{ widget.type }}" name="{{ widget.name }}" {% if widget.value != None %}
11+
value="{{ widget.value|stringformat:'s' }}"{% endif %}{% include "django/forms/widgets/attrs.html" %} >
12+
{% endwith %}
13+
<svg class=" rounded-full"
1214
aria-label="enabled"
1315
xmlns="http://www.w3.org/2000/svg"
1416
viewBox="0 0 24 24"
15-
fill="none"
17+
fill="red"
1618
stroke="currentColor"
1719
stroke-width="4"
1820
stroke-linecap="round"
@@ -21,7 +23,7 @@
2123
<path d="M18 6 6 18"/>
2224
<path d="m6 6 12 12"/>
2325
</svg>
24-
<svg aria-label="disabled" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
26+
<svg class="bg-success rounded-full" aria-label="disabled" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
2527
<g
2628
stroke-linejoin="round"
2729
stroke-linecap="round"

0 commit comments

Comments
 (0)