Allow @custom-variant
to redefine built-in variants with proper order
.
#18070
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.
Summary
Adds an "override" property to the object bag passed to
Variants.static
which forces a variant to get a neworder
even if it has already been defined. This property is set inindex.ts:399
for the@custom-variant
rule to allow custom variants to redefine existing variants likeactive:
and have them be properly ordered relative to other custom variants, a.l.a tailwind v3. See #18067 for the motivating regression.Test plan
Tested using the playground directory. This is a very insignificant (~17 LOC) change which I don't expect to cause many new issues. I can add more robust testing if necessary, just let me know.