From 70a11d94f6fd7344a206f6b747b9007f1ecdada0 Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Tue, 13 Feb 2024 14:41:02 +0100 Subject: [PATCH 01/26] Update tailwind_field.py --- crispy_tailwind/templatetags/tailwind_field.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crispy_tailwind/templatetags/tailwind_field.py b/crispy_tailwind/templatetags/tailwind_field.py index 5deb827..308f6b9 100644 --- a/crispy_tailwind/templatetags/tailwind_field.py +++ b/crispy_tailwind/templatetags/tailwind_field.py @@ -110,7 +110,7 @@ class CrispyTailwindFieldNode(template.Node): "error_border": "border-red-500", } - default_container = CSSContainer(default_styles) + default_container = CSSContainer({**default_styles, **getattr(settings, "CRISPY_TAILWIND_STYLE", {})}) def __init__(self, field, attrs): self.field = field From 0535c32a1c903a7449c4a75a585b92c46d97ccb4 Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Tue, 13 Feb 2024 14:55:35 +0100 Subject: [PATCH 02/26] Update tailwind_field.py --- .../templatetags/tailwind_field.py | 78 +++++++++++-------- 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/crispy_tailwind/templatetags/tailwind_field.py b/crispy_tailwind/templatetags/tailwind_field.py index 308f6b9..7fe2bb8 100644 --- a/crispy_tailwind/templatetags/tailwind_field.py +++ b/crispy_tailwind/templatetags/tailwind_field.py @@ -75,42 +75,52 @@ def pairwise(iterable): a = iter(iterable) return zip(a, a) +@register.filter +def tailwind_field_class(field): + """ + Returns field class from defaults. + """ + return f" {tailwind_container.get_input_class(field)}" + +base_input = ( + "bg-white focus:outline-none border border-gray-300 rounded-lg py-2 px-4 block w-full " + "appearance-none leading-normal text-gray-700" +) + +default_styles = { + "text": base_input, + "number": base_input, + "radioselect": "", + "email": base_input, + "url": base_input, + "password": base_input, + "hidden": "", + "multiplehidden": "", + "file": "", + "clearablefile": "", + "textarea": base_input, + "date": base_input, + "datetime": base_input, + "time": base_input, + "checkbox": "", + "select": "", + "nullbooleanselect": "", + "selectmultiple": "", + "checkboxselectmultiple": "", + "multi": "", + "splitdatetime": "text-gray-700 bg-white focus:outline border border-gray-300 leading-normal px-4 " + "appearance-none rounded-lg py-2 focus:outline-none mr-2", + "splithiddendatetime": "", + "selectdate": "", + "error_border": "border-red-500", +} + +tailwind_styles = {**default_styles, **getattr(settings, "CRISPY_TAILWIND_STYLE", {})} +tailwind_container = CSSContainer(tailwind_styles) class CrispyTailwindFieldNode(template.Node): - base_input = ( - "bg-white focus:outline-none border border-gray-300 rounded-lg py-2 px-4 block w-full " - "appearance-none leading-normal text-gray-700" - ) - - default_styles = { - "text": base_input, - "number": base_input, - "radioselect": "", - "email": base_input, - "url": base_input, - "password": base_input, - "hidden": "", - "multiplehidden": "", - "file": "", - "clearablefile": "", - "textarea": base_input, - "date": base_input, - "datetime": base_input, - "time": base_input, - "checkbox": "", - "select": "", - "nullbooleanselect": "", - "selectmultiple": "", - "checkboxselectmultiple": "", - "multi": "", - "splitdatetime": "text-gray-700 bg-white focus:outline border border-gray-300 leading-normal px-4 " - "appearance-none rounded-lg py-2 focus:outline-none mr-2", - "splithiddendatetime": "", - "selectdate": "", - "error_border": "border-red-500", - } - - default_container = CSSContainer({**default_styles, **getattr(settings, "CRISPY_TAILWIND_STYLE", {})}) + + default_container = tailwind_container def __init__(self, field, attrs): self.field = field From 5f1440440e89384c80afd4e5896f6c9f7650c882 Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Tue, 13 Feb 2024 15:02:31 +0100 Subject: [PATCH 03/26] Update tailwind_field.py --- crispy_tailwind/templatetags/tailwind_field.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crispy_tailwind/templatetags/tailwind_field.py b/crispy_tailwind/templatetags/tailwind_field.py index 7fe2bb8..923564a 100644 --- a/crispy_tailwind/templatetags/tailwind_field.py +++ b/crispy_tailwind/templatetags/tailwind_field.py @@ -103,7 +103,7 @@ def tailwind_field_class(field): "datetime": base_input, "time": base_input, "checkbox": "", - "select": "", + "select": "bg-white border-gray-300 focus:outline-none border rounded-lg py-2 px-4 block w-full appearance-none leading-normal text-gray-700", "nullbooleanselect": "", "selectmultiple": "", "checkboxselectmultiple": "", From f691dba51c309ad3c64a03b47ba3915d9c9034e1 Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Tue, 13 Feb 2024 15:14:33 +0100 Subject: [PATCH 04/26] Update select.html --- crispy_tailwind/templates/tailwind/layout/select.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crispy_tailwind/templates/tailwind/layout/select.html b/crispy_tailwind/templates/tailwind/layout/select.html index a692ee9..b6edf14 100644 --- a/crispy_tailwind/templates/tailwind/layout/select.html +++ b/crispy_tailwind/templates/tailwind/layout/select.html @@ -1,9 +1,9 @@ {% load crispy_forms_filters %} -{% load tailwind_filters %} +{% load tailwind_filters tailwind_field %} {% load l10n %}
- {% for group, options, index in field|optgroups %} {% if group %}{% endif %} {% for option in options %} From b6092a50409e9cb846a3f08afc3dd3d033f28d7f Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 13 Feb 2024 20:21:45 +0100 Subject: [PATCH 05/26] fix black --- crispy_tailwind/templatetags/tailwind_field.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crispy_tailwind/templatetags/tailwind_field.py b/crispy_tailwind/templatetags/tailwind_field.py index 923564a..16c72f5 100644 --- a/crispy_tailwind/templatetags/tailwind_field.py +++ b/crispy_tailwind/templatetags/tailwind_field.py @@ -75,6 +75,7 @@ def pairwise(iterable): a = iter(iterable) return zip(a, a) + @register.filter def tailwind_field_class(field): """ @@ -82,6 +83,7 @@ def tailwind_field_class(field): """ return f" {tailwind_container.get_input_class(field)}" + base_input = ( "bg-white focus:outline-none border border-gray-300 rounded-lg py-2 px-4 block w-full " "appearance-none leading-normal text-gray-700" @@ -118,8 +120,8 @@ def tailwind_field_class(field): tailwind_styles = {**default_styles, **getattr(settings, "CRISPY_TAILWIND_STYLE", {})} tailwind_container = CSSContainer(tailwind_styles) -class CrispyTailwindFieldNode(template.Node): +class CrispyTailwindFieldNode(template.Node): default_container = tailwind_container def __init__(self, field, attrs): From af19990d942512f1d157c75e8f26599f4a7f6b31 Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 13 Feb 2024 20:30:01 +0100 Subject: [PATCH 06/26] add documentation --- docs/getting_started.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/getting_started.txt b/docs/getting_started.txt index 6fb56c5..6707224 100644 --- a/docs/getting_started.txt +++ b/docs/getting_started.txt @@ -98,3 +98,19 @@ You can also prepend or append like so:: {% crispy_addon form.my_field prepend="$" %} {% crispy_addon form.my_field append=".00" %} + +Configuring default field_classes with CRISPY_TAILWIND_STYLE +============================================================ + +Cou can configure/overwrite the default classes for the different fields in your settings. +To do so you need to configure the dict ``CRISPY_TAILWIND_STYLE`` in you settings like so: + +``CRISPY_TAILWIND_STYLE = { + "text": "bg-gray-50 border border-gray-300", + "select": "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", +}`` + +This is currently only working for the input fields and the select field. More coming soon. + + + From b21bcd54e933de548d7805526f5fe5e8c5ead8c4 Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 13 Feb 2024 20:30:38 +0100 Subject: [PATCH 07/26] fix black --- docs/getting_started.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started.txt b/docs/getting_started.txt index 6707224..ac6bfaf 100644 --- a/docs/getting_started.txt +++ b/docs/getting_started.txt @@ -102,7 +102,7 @@ You can also prepend or append like so:: Configuring default field_classes with CRISPY_TAILWIND_STYLE ============================================================ -Cou can configure/overwrite the default classes for the different fields in your settings. +You can configure/overwrite the default classes for the different fields in your settings. To do so you need to configure the dict ``CRISPY_TAILWIND_STYLE`` in you settings like so: ``CRISPY_TAILWIND_STYLE = { From 60cc327001a182156c13c9aa203bc3b97c2cdf3e Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 13 Feb 2024 20:31:19 +0100 Subject: [PATCH 08/26] push --- docs/getting_started.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/getting_started.txt b/docs/getting_started.txt index ac6bfaf..5588086 100644 --- a/docs/getting_started.txt +++ b/docs/getting_started.txt @@ -111,6 +111,3 @@ To do so you need to configure the dict ``CRISPY_TAILWIND_STYLE`` in you setting }`` This is currently only working for the input fields and the select field. More coming soon. - - - From 12d18623c1dc8d1d18bbec0b0bf8730eba2ad190 Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Sat, 24 Feb 2024 13:31:49 +0100 Subject: [PATCH 09/26] Update custom.txt --- docs/custom.txt | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/docs/custom.txt b/docs/custom.txt index afaafad..36332db 100644 --- a/docs/custom.txt +++ b/docs/custom.txt @@ -2,18 +2,35 @@ Custom Styles ============= -With Tailwind being a utility framework there is much more ability to customise -your site than with many of the other CSS frameworks such as Bootstrap. +The first way is to override CRISPY_TAILWIND_STYLE in your settings. This will override the defaults for all forms. +This is handy for when you want to easily configure classes for all your forms, as forms in a project usually have the same uniform styling. -While our opinionated Tailwind styles may get you so far you may wish to change these. +The second way is to configure ``CSSContainer`` on a specific form. This will only work for forms that use FormHelper. +This allows you to override a specific form, this is usefull for unique/complex forms. + +The idea is that you can easily configure all forms by overriding CRISPY_TAILWIND_STYLE in settings, and if you want to customize a specific form, you can use CSSContainer for that specific form. The Tailwind template pack aims to help you customise your form in a DRY way. This template pack comes with a utility class called `CSSContainer` which can be attached to your form helper. ------------- -CSSContainer ------------- +The documentation on CSSContainer is a bit under-developed, more documentation coming soon. + +----------------------------------------------------------------------------- +1. Configuring custom tailwind classes in settings with CRISPY_TAILWIND_STYLE +----------------------------------------------------------------------------- + +Example: +``CRISPY_TAILWIND_STYLE = { + "text": "bg-gray-50 border border-gray-300", + "select": "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", +}`` +This is currently only working for the input fields and the select field. More coming soon. + + +--------------- +2. CSSContainer +--------------- `CSSContainer` is imported from `crispy_tailwind.tailwind`. This is a class which holds the CSS style for your form. Currently it holds the classes for the `` tags within your form. @@ -65,3 +82,7 @@ You can also update add and remove styles:: 'email': 'bg-white', ... } + + + + From 30ad23617735a615d19c088479bff0d67093c583 Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Sat, 24 Feb 2024 13:32:05 +0100 Subject: [PATCH 10/26] Update getting_started.txt --- docs/getting_started.txt | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/docs/getting_started.txt b/docs/getting_started.txt index 5588086..6fb56c5 100644 --- a/docs/getting_started.txt +++ b/docs/getting_started.txt @@ -98,16 +98,3 @@ You can also prepend or append like so:: {% crispy_addon form.my_field prepend="$" %} {% crispy_addon form.my_field append=".00" %} - -Configuring default field_classes with CRISPY_TAILWIND_STYLE -============================================================ - -You can configure/overwrite the default classes for the different fields in your settings. -To do so you need to configure the dict ``CRISPY_TAILWIND_STYLE`` in you settings like so: - -``CRISPY_TAILWIND_STYLE = { - "text": "bg-gray-50 border border-gray-300", - "select": "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", -}`` - -This is currently only working for the input fields and the select field. More coming soon. From e9fbfdf72ae351bf3aa403ca97054e6e0456c760 Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Sat, 24 Feb 2024 13:33:16 +0100 Subject: [PATCH 11/26] Update custom.txt --- docs/custom.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/custom.txt b/docs/custom.txt index 36332db..b67e2b3 100644 --- a/docs/custom.txt +++ b/docs/custom.txt @@ -82,7 +82,3 @@ You can also update add and remove styles:: 'email': 'bg-white', ... } - - - - From f37dd37d49a9c760aaef9ecf5ebf8eddd354d8b3 Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Sat, 24 Feb 2024 13:40:05 +0100 Subject: [PATCH 12/26] Update select.html --- crispy_tailwind/templates/tailwind/layout/select.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crispy_tailwind/templates/tailwind/layout/select.html b/crispy_tailwind/templates/tailwind/layout/select.html index b6edf14..33ec4a6 100644 --- a/crispy_tailwind/templates/tailwind/layout/select.html +++ b/crispy_tailwind/templates/tailwind/layout/select.html @@ -3,7 +3,7 @@ {% load l10n %}
- {% for group, options, index in field|optgroups %} {% if group %}{% endif %} {% for option in options %} From 2131738c4d389f36a37dd2c2522e4696feb0a93b Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Sat, 24 Feb 2024 13:41:39 +0100 Subject: [PATCH 13/26] Update crispy_filter.html --- tests/results/filter/crispy_filter.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/results/filter/crispy_filter.html b/tests/results/filter/crispy_filter.html index b9e9bfa..394b2ae 100644 --- a/tests/results/filter/crispy_filter.html +++ b/tests/results/filter/crispy_filter.html @@ -62,8 +62,7 @@ terms of service*
- From 50609dcc8c80e2bb79ed74db4134637f33aa3be3 Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Sat, 24 Feb 2024 13:41:58 +0100 Subject: [PATCH 14/26] Update tailwind_field.py --- crispy_tailwind/templatetags/tailwind_field.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crispy_tailwind/templatetags/tailwind_field.py b/crispy_tailwind/templatetags/tailwind_field.py index 16c72f5..f169a6b 100644 --- a/crispy_tailwind/templatetags/tailwind_field.py +++ b/crispy_tailwind/templatetags/tailwind_field.py @@ -105,7 +105,7 @@ def tailwind_field_class(field): "datetime": base_input, "time": base_input, "checkbox": "", - "select": "bg-white border-gray-300 focus:outline-none border rounded-lg py-2 px-4 block w-full appearance-none leading-normal text-gray-700", + "select": "bg-white focus:outline-none border border-gray-300 rounded-lg py-2 px-4 block w-full appearance-none leading-normal text-gray-700", "nullbooleanselect": "", "selectmultiple": "", "checkboxselectmultiple": "", From 9017693ebe8f4eef2765be419203c9978634b2aa Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Sat, 24 Feb 2024 13:44:14 +0100 Subject: [PATCH 15/26] Update crispy_filter.html --- tests/results/filter/crispy_filter.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/results/filter/crispy_filter.html b/tests/results/filter/crispy_filter.html index 394b2ae..46763b8 100644 --- a/tests/results/filter/crispy_filter.html +++ b/tests/results/filter/crispy_filter.html @@ -62,7 +62,8 @@ terms of service*
- From 4fa7e3bb69b9f5e391f97cda24477262e853ff29 Mon Sep 17 00:00:00 2001 From: thomas Date: Sat, 24 Feb 2024 14:05:12 +0100 Subject: [PATCH 16/26] add classes to multiple select --- crispy_tailwind/templatetags/tailwind_field.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crispy_tailwind/templatetags/tailwind_field.py b/crispy_tailwind/templatetags/tailwind_field.py index f169a6b..7a9279e 100644 --- a/crispy_tailwind/templatetags/tailwind_field.py +++ b/crispy_tailwind/templatetags/tailwind_field.py @@ -107,7 +107,7 @@ def tailwind_field_class(field): "checkbox": "", "select": "bg-white focus:outline-none border border-gray-300 rounded-lg py-2 px-4 block w-full appearance-none leading-normal text-gray-700", "nullbooleanselect": "", - "selectmultiple": "", + "selectmultiple": "bg-white focus:outline-none border border-gray-300 rounded-lg py-2 px-4 block w-full appearance-none leading-normal text-gray-700", "checkboxselectmultiple": "", "multi": "", "splitdatetime": "text-gray-700 bg-white focus:outline border border-gray-300 leading-normal px-4 " From c65735a67bc2fe0d3406e0b8a3f44485c222d35d Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Sat, 24 Feb 2024 14:11:40 +0100 Subject: [PATCH 17/26] Update custom.txt --- docs/custom.txt | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/custom.txt b/docs/custom.txt index b67e2b3..77bc0b8 100644 --- a/docs/custom.txt +++ b/docs/custom.txt @@ -2,7 +2,9 @@ Custom Styles ============= -The first way is to override CRISPY_TAILWIND_STYLE in your settings. This will override the defaults for all forms. +There are currently two ways to customize the tailwind classes for your forms. + +The first one is to override CRISPY_TAILWIND_STYLE in your settings. This will override the defaults for all forms. This is handy for when you want to easily configure classes for all your forms, as forms in a project usually have the same uniform styling. The second way is to configure ``CSSContainer`` on a specific form. This will only work for forms that use FormHelper. @@ -27,6 +29,33 @@ Example: }`` This is currently only working for the input fields and the select field. More coming soon. +These are the fields you can override: +CRISPY_TAILWIND_STYLE = { + "text": "", + "number": "", + "radioselect": "", + "email": "", + "url": "", + "password": "", + "hidden": "", + "multiplehidden": "", + "file": "", + "clearablefile": "", + "textarea": "", + "date": "", + "datetime": "", + "time": "", + "checkbox": "", + "select": "", + "nullbooleanselect": "", + "selectmultiple": "", + "checkboxselectmultiple": "", + "multi": "", + "splitdatetime": "", + "splithiddendatetime": "", + "selectdate": "", + "error_border": "", +} --------------- 2. CSSContainer From 523633c60eee73a3de794c47cf1577dfa041d987 Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:25:08 +0200 Subject: [PATCH 18/26] Update tailwind_field.py --- crispy_tailwind/templatetags/tailwind_field.py | 1 + 1 file changed, 1 insertion(+) diff --git a/crispy_tailwind/templatetags/tailwind_field.py b/crispy_tailwind/templatetags/tailwind_field.py index 7a9279e..a726d94 100644 --- a/crispy_tailwind/templatetags/tailwind_field.py +++ b/crispy_tailwind/templatetags/tailwind_field.py @@ -117,6 +117,7 @@ def tailwind_field_class(field): "error_border": "border-red-500", } +# Overwrite tailwind_styles values with the CRISPY_TAILWIND_STYLE values from settings tailwind_styles = {**default_styles, **getattr(settings, "CRISPY_TAILWIND_STYLE", {})} tailwind_container = CSSContainer(tailwind_styles) From a78b90808366b3b6188d940f61d43924eaf3155d Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:28:42 +0200 Subject: [PATCH 19/26] Update custom.txt --- docs/custom.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/custom.txt b/docs/custom.txt index 77bc0b8..7a91cc2 100644 --- a/docs/custom.txt +++ b/docs/custom.txt @@ -22,8 +22,7 @@ The documentation on CSSContainer is a bit under-developed, more documentation c 1. Configuring custom tailwind classes in settings with CRISPY_TAILWIND_STYLE ----------------------------------------------------------------------------- -Example: -``CRISPY_TAILWIND_STYLE = { +Example:``CRISPY_TAILWIND_STYLE = { "text": "bg-gray-50 border border-gray-300", "select": "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", }`` @@ -56,7 +55,6 @@ CRISPY_TAILWIND_STYLE = { "selectdate": "", "error_border": "", } - --------------- 2. CSSContainer --------------- From f0353dce892b63ae54d6cb1d445a611186ff2db7 Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:32:42 +0200 Subject: [PATCH 20/26] Update custom.txt --- docs/custom.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/custom.txt b/docs/custom.txt index 7a91cc2..cce3c31 100644 --- a/docs/custom.txt +++ b/docs/custom.txt @@ -22,10 +22,12 @@ The documentation on CSSContainer is a bit under-developed, more documentation c 1. Configuring custom tailwind classes in settings with CRISPY_TAILWIND_STYLE ----------------------------------------------------------------------------- -Example:``CRISPY_TAILWIND_STYLE = { +Example: +```CRISPY_TAILWIND_STYLE = { "text": "bg-gray-50 border border-gray-300", "select": "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", -}`` +}``` + This is currently only working for the input fields and the select field. More coming soon. These are the fields you can override: From c3d8f158fe0e2ab249b0a08c2ddf90bc71e6794d Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:34:31 +0200 Subject: [PATCH 21/26] Update custom.txt --- docs/custom.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/custom.txt b/docs/custom.txt index cce3c31..66a8277 100644 --- a/docs/custom.txt +++ b/docs/custom.txt @@ -23,10 +23,10 @@ The documentation on CSSContainer is a bit under-developed, more documentation c ----------------------------------------------------------------------------- Example: -```CRISPY_TAILWIND_STYLE = { +CRISPY_TAILWIND_STYLE = { "text": "bg-gray-50 border border-gray-300", "select": "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", -}``` +} This is currently only working for the input fields and the select field. More coming soon. From b9e47b775f19840c5524d130ca2d9af104b65eb7 Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:37:31 +0200 Subject: [PATCH 22/26] Update custom.txt --- docs/custom.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/custom.txt b/docs/custom.txt index 66a8277..c6e1532 100644 --- a/docs/custom.txt +++ b/docs/custom.txt @@ -57,6 +57,7 @@ CRISPY_TAILWIND_STYLE = { "selectdate": "", "error_border": "", } + --------------- 2. CSSContainer --------------- From 71b2f133a8e585f95b4dec44fa52a5010bf4866f Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:39:13 +0200 Subject: [PATCH 23/26] Update custom.txt --- docs/custom.txt | 60 ++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/docs/custom.txt b/docs/custom.txt index c6e1532..a6a6749 100644 --- a/docs/custom.txt +++ b/docs/custom.txt @@ -23,40 +23,40 @@ The documentation on CSSContainer is a bit under-developed, more documentation c ----------------------------------------------------------------------------- Example: -CRISPY_TAILWIND_STYLE = { - "text": "bg-gray-50 border border-gray-300", - "select": "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", -} + CRISPY_TAILWIND_STYLE = { + "text": "bg-gray-50 border border-gray-300", + "select": "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", + } This is currently only working for the input fields and the select field. More coming soon. These are the fields you can override: -CRISPY_TAILWIND_STYLE = { - "text": "", - "number": "", - "radioselect": "", - "email": "", - "url": "", - "password": "", - "hidden": "", - "multiplehidden": "", - "file": "", - "clearablefile": "", - "textarea": "", - "date": "", - "datetime": "", - "time": "", - "checkbox": "", - "select": "", - "nullbooleanselect": "", - "selectmultiple": "", - "checkboxselectmultiple": "", - "multi": "", - "splitdatetime": "", - "splithiddendatetime": "", - "selectdate": "", - "error_border": "", -} + CRISPY_TAILWIND_STYLE = { + "text": "", + "number": "", + "radioselect": "", + "email": "", + "url": "", + "password": "", + "hidden": "", + "multiplehidden": "", + "file": "", + "clearablefile": "", + "textarea": "", + "date": "", + "datetime": "", + "time": "", + "checkbox": "", + "select": "", + "nullbooleanselect": "", + "selectmultiple": "", + "checkboxselectmultiple": "", + "multi": "", + "splitdatetime": "", + "splithiddendatetime": "", + "selectdate": "", + "error_border": "", + } --------------- 2. CSSContainer From 3e85456e297667e7141311517fb5f18a5492653f Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:41:33 +0200 Subject: [PATCH 24/26] Update custom.txt --- docs/custom.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/custom.txt b/docs/custom.txt index a6a6749..7695439 100644 --- a/docs/custom.txt +++ b/docs/custom.txt @@ -23,6 +23,7 @@ The documentation on CSSContainer is a bit under-developed, more documentation c ----------------------------------------------------------------------------- Example: + CRISPY_TAILWIND_STYLE = { "text": "bg-gray-50 border border-gray-300", "select": "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", @@ -31,6 +32,7 @@ Example: This is currently only working for the input fields and the select field. More coming soon. These are the fields you can override: + CRISPY_TAILWIND_STYLE = { "text": "", "number": "", From 9d0201e166ef0ca54cc7cec490d8684aea9dc1e7 Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:43:22 +0200 Subject: [PATCH 25/26] Update custom.txt --- docs/custom.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/custom.txt b/docs/custom.txt index 7695439..18ec234 100644 --- a/docs/custom.txt +++ b/docs/custom.txt @@ -29,6 +29,7 @@ Example: "select": "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", } + This is currently only working for the input fields and the select field. More coming soon. These are the fields you can override: @@ -60,6 +61,7 @@ These are the fields you can override: "error_border": "", } + --------------- 2. CSSContainer --------------- From df8213012f31b9d671559ed97a8cb1056ea7ed50 Mon Sep 17 00:00:00 2001 From: Thumose3 <45205349+Thutmose3@users.noreply.github.com> Date: Thu, 1 Aug 2024 23:18:50 +0200 Subject: [PATCH 26/26] Update custom.txt --- docs/custom.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/custom.txt b/docs/custom.txt index 18ec234..a6cb1c3 100644 --- a/docs/custom.txt +++ b/docs/custom.txt @@ -22,7 +22,7 @@ The documentation on CSSContainer is a bit under-developed, more documentation c 1. Configuring custom tailwind classes in settings with CRISPY_TAILWIND_STYLE ----------------------------------------------------------------------------- -Example: +Example:: CRISPY_TAILWIND_STYLE = { "text": "bg-gray-50 border border-gray-300", @@ -32,7 +32,7 @@ Example: This is currently only working for the input fields and the select field. More coming soon. -These are the fields you can override: +These are the fields you can override:: CRISPY_TAILWIND_STYLE = { "text": "",