refactor: remove support for non-tw usage #92
Merged
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.
Currently
apply
,css
,keyframes
andanimation
support non-tw usage:This works as the returned function have
toString
andvalueOf
method which use the boundtw
to generate the styles. Using a customtw
instance is supported by:This feature is quite difficult to understand for beginners and maybe confusing when stumbled on it in the docs. By removing it we can enforce that only explicit
tw
calls generate and inject styles. No magic!I would like to drop this in favor of requiring the explicit use of
tw
or using a helper:I think that most use cases can be achieved now using a combination of
tw
withapply
,css
,keyframes
andanimation
.Would do you think? @tw-in-js/contributors