From 7f1039c0420fb31f54e53de0f742460930b50d74 Mon Sep 17 00:00:00 2001 From: Ivan Kancijan Date: Tue, 24 Sep 2024 11:31:00 +0200 Subject: [PATCH 1/2] remove bool to string conversion --- src/Helpers/TailwindTrait.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Helpers/TailwindTrait.php b/src/Helpers/TailwindTrait.php index 16b9c7b0..82751a44 100644 --- a/src/Helpers/TailwindTrait.php +++ b/src/Helpers/TailwindTrait.php @@ -254,7 +254,7 @@ public static function getTwClasses($attributes, $manifest, ...$custom) $combinationClasses = []; if (isset($manifest['tailwind']['combinations'])) { - foreach ($manifest['tailwind']['combinations'] as $attributeName => $value) { + foreach ($manifest['tailwind']['combinations'] as $value) { $conditions = $value['attributes']; $twClasses = $value['twClasses']; @@ -267,10 +267,6 @@ public static function getTwClasses($attributes, $manifest, ...$custom) foreach ($conditions as $key => $attrConditions) { $value = Helpers::checkAttr($key, $attributes, $manifest, true); - if (\is_bool($value)) { - $value = $value ? 'true' : 'false'; - } - $isArrayCondition = \is_array($attrConditions); if (!$value) { From e17286dd579458be1287e55f33af21135d83d68c Mon Sep 17 00:00:00 2001 From: Ivan Kancijan Date: Tue, 24 Sep 2024 13:23:36 +0200 Subject: [PATCH 2/2] allow false as a value --- src/Helpers/TailwindTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Helpers/TailwindTrait.php b/src/Helpers/TailwindTrait.php index 82751a44..2e40fba3 100644 --- a/src/Helpers/TailwindTrait.php +++ b/src/Helpers/TailwindTrait.php @@ -269,7 +269,7 @@ public static function getTwClasses($attributes, $manifest, ...$custom) $isArrayCondition = \is_array($attrConditions); - if (!$value) { + if ($value === '' || $value === null) { $matches = false; break; } elseif ($isArrayCondition && !\in_array($value, $attrConditions, true)) {