-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement fallback plugins when arbitrary values result in css from m…
…ultiple plugins (#9376) * use test with non-any type plugin * choose backgroundSize over backgroundPosition Ensure that `backgroundColor` can take any value * add tests to verify fallback plugins * implement fallback plugins Whenever an arbitrary value results in css from multiple plugins we first try to resolve a falback plugin. The fallback mechanism works like this: - If A has type `any` and B has type `color`, then B should win. > This is because `A` will match *anything*, but the more precise type should win instead. E.g.: `backgroundColor` has the type `any` so `bg-[100px_200px]` would match both the `backgroundColor` and `backgroundSize` but `backgroundSize` matched because of a specific type and not because of the `any` type. - If A has type `length` and B has type `[length, { disambiguate: true }]`, then B should win. > This is because `B` marked the `length` as the plugin that should win in case a clash happens. * Add any type to a handful of plugins Needs tests tho * Add any type to `border-{x,y,t,r,b,l}` plugins * Add test for any type * Split on multiple lines * fixup * add tests for implicit `any` types * rename `disambiguate` to `preferOnConflict` * update tests to reflect `any` types a bit better * update changelog * annotate any-type test with a bit more information Just for future debugging reasons! Co-authored-by: Jordan Pittman <jordan@cryptica.me>
- Loading branch information
1 parent
52ab315
commit 94d6e72
Showing
10 changed files
with
997 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.