Callback in theme properties is also the theme function#14659
Merged
Conversation
04e533b to
5410f18
Compare
Member
|
Looks like we do have some type issues but otherwise this looks good |
| theme: themeFn, | ||
| colors, | ||
| } | ||
| }) |
Contributor
There was a problem hiding this comment.
I'm like 95% sure this is not documented anywhere. Pretty sure the types for v3 consider this usage invalid too. We'll still need to support it for B/C reasons but I think we should introduce a wrapper function that warns the first time its used.
cc @philipp-spiess @RobinMalfait thoughts?
philipp-spiess
added a commit
that referenced
this pull request
Oct 14, 2024
Quick follow-up to #14659 base don @thecrypticace's idea: - This behavior is no longer added to the types of the Plugin API to be consistent with v3 - When the plugin argument is used as a function, we now warn the first time
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Something we noticed while testing the codemods on one of our codebases is that the callback passed to the
themefunction properties doesn't only expose some properties likecolors, but it's also a function itself.E.g.: https://play.tailwindcss.com/eV7Jgv17X1?file=config
h/t to @RobinMalfait for the issue description