Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collision Fixes #16

Merged
merged 3 commits into from
Mar 30, 2024
Merged

Collision Fixes #16

merged 3 commits into from
Mar 30, 2024

Conversation

nicoburniske
Copy link
Member

@nicoburniske nicoburniske commented Mar 30, 2024

  • line-height and font-size
  • arbitrary values
  • Single digit decimal parsing

Fixes all non prefix-modifier order bugs uncovered in #14

Reasoning for keeping unique ordering of prefix-modifier from issue:

--- expected
+++ actual
@@ -1 +1 @@
-"hover:block focus:hover:inline"
+"hover:block hover:focus:inline focus:hover:inline"

These two prefix modifiers actually create different tailwind classes, so I elected to handle them separately. If they were the same, wouldn't they only generate one tailwind class? I am open to hearing why they should be considered the same though.

.focus\:hover\:inline:hover:focus{
  display: inline
}

.hover\:focus\:inline:focus:hover{
  display: inline
}

Copy link

vercel bot commented Mar 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tailwind-fuse ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 30, 2024 3:13pm

@nicoburniske
Copy link
Member Author

nicoburniske commented Mar 30, 2024

  1. Failure:
    TestModifiers#test_conflicts_across_prefix_modifiers [test/test_modifiers.rb:13]:
--- expected
+++ actual
@@ -1 +1 @@
-"hover:block focus:hover:inline"
+"hover:block hover:focus:inline focus:hover:inline"
  1. Failure:
    TestModifiers#test_conflicts_across_postfix_modifiers [test/test_modifiers.rb:20]:
Expected: "text-lg/none"
  Actual: "leading-9 text-lg/none"
  1. Failure:
    TestArbitraryProperties#test_handles_important_modifier_correctly [test/test_arbitrary_properties.rb:31]:
--- expected
+++ actual
@@ -1 +1 @@
-"[some:one] ![some:another]"
+"![some:prop] [some:other] [some:one] ![some:another]"
  1. Failure:
    TestArbitraryProperties#test_handles_arbitrary_property_conflicts_correctly [test/test_arbitrary_properties.rb:11]:
--- expected
+++ actual
@@ -1 +1 @@
-"[paint-order:normal]"
+"[paint-order:markers] [paint-order:normal]"
  1. Failure:
    TestArbitraryProperties#test_handles_arbitrary_property_conflicts_with_modifiers_correctly [test/test_arbitrary_properties.rb:18]:
--- expected
+++ actual
@@ -1 +1 @@
-"hover:[paint-order:normal]"
+"hover:[paint-order:markers] hover:[paint-order:normal]"
  1. Failure:
    TestArbitraryProperties#test_handles_complex_arbitrary_property_conflicts_correctly [test/test_arbitrary_properties.rb:26]:
--- expected
+++ actual
@@ -1 +1 @@
-"[-unknown-prop:url(https://hi.com)]"
+"[-unknown-prop:::123:::] [-unknown-prop:url(https://hi.com)]"
  1. Failure:
    TestArbitraryValues#test_handles_arbitrary_length_conflicts_with_labels_and_modifiers_correctly [test/test_arbitrary_values.rb:31]:
--- expected
+++ actual
@@ -1 +1 @@
-"focus:hover:m-[length:var(--c)]"
+"hover:focus:m-[2px] focus:hover:m-[length:var(--c)]"
  1. Failure:
    TestPrefixes#test_prefix_working_corectly [test/test_prefixes.rb:11]:
Expected: "tw-hidden"
  Actual: "tw-block tw-hidden"
  1. Failure:
    TestTailwindMerge#test_it_basically_works [test/test_tailwind_merge.rb:18]:
Expected: "stroke-[3]"
  Actual: "stroke-2 stroke-[3]"
  1. Failure:
    TestSeparator#test_single_character_separator_working_correctly [test/test_seperator.rb:12]:
--- expected
+++ actual
@@ -1 +1 @@
-"focus_hover_!inset-0"
+"hover_focus_!right-0 focus_hover_!inset-0"
  1. Failure:
    TestSeparator#test_multiple_character_separator_working_correctly [test/test_seperator.rb:22]:
--- expected
+++ actual
@@ -1 +1 @@
-"focus__hover__!inset-0"
+"hover__focus__!right-0 focus__hover__!inset-0"
  1. Failure:
    TestTailwindCSSVersions#test_tailwind_3_4_features [test/test_tailwind_css_versions.rb:39]:
--- expected
+++ actual
@@ -1 +1 @@
-"has-[[data-potato]]:p-2 group-has-[:checked]:flex"
+"has-[[data-potato]]:p-1 has-[[data-potato]]:p-2 group-has-[:checked]:grid group-has-[:checked]:flex"
  1. Failure:
    TestTailwindCSSVersions#test_tailwind_3_3_features [test/test_tailwind_css_versions.rb:14]:
Expected: "text-red text-lg/8"
  Actual: "text-lg/8"
  1. Failure:
    TestArbitraryVariants#test_arbitrary_variants_with_modifiers [test/test_arbitrary_variants.rb:18]:
--- expected
+++ actual
@@ -1 +1 @@
-"dark:hover:lg:[&>*]:line-through"
+"dark:lg:hover:[&>*]:underline dark:hover:lg:[&>*]:line-through"
  1. Failure:
    TestArbitraryVariants#test_arbitrary_variants_with_arbitrary_properties [test/test_arbitrary_variants.rb:45]:
--- expected
+++ actual
@@ -1 +1 @@
-"[&>*]:[color:blue]"
+"[&>*]:[color:red] [&>*]:[color:blue]"
  1. Failure:
    TestArbitraryVariants#test_multiple_arbitrary_variants [test/test_arbitrary_variants.rb:40]:
--- expected
+++ actual
@@ -1 +1 @@
-"dark:hover:[&>*]:disabled:focus:[&_div]:line-through"
+"hover:dark:[&>*]:focus:disabled:[&_div]:underline dark:hover:[&>*]:disabled:focus:[&_div]:line-through"
  1. Failure:
    TestNegativeValues#test_handles_conflicts_across_groups_with_negative_values_correctly [test/test_negative_values.rb:22]:
--- expected
+++ actual
@@ -1 +1 @@
-"focus:hover:inset-x-1"
+"hover:focus:-right-1 focus:hover:inset-x-1"
  1. Failure:
    TestNegativeValues#test_handles_conflicts_between_positive_and_negative_values_correctly [test/test_negative_values.rb:17]:
Expected: "-top-69"
  Actual: "top-12 -top-69"
  1. Failure:
    TestNegativeValues#test_handles_negative_value_conflicts_correctly [test/test_negative_values.rb:12]:
Expected: "-top-2000"
  Actual: "-top-12 -top-2000"

@nicoburniske nicoburniske merged commit aeb2773 into main Mar 30, 2024
3 checks passed
@nicoburniske nicoburniske deleted the fixes branch March 30, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant