feat(class-variance): class-variance authority with slot support, and conflict-aware merging#2105
Open
iamdadmin wants to merge 8 commits intotempestphp:3.xfrom
Open
feat(class-variance): class-variance authority with slot support, and conflict-aware merging#2105iamdadmin wants to merge 8 commits intotempestphp:3.xfrom
iamdadmin wants to merge 8 commits intotempestphp:3.xfrom
Conversation
Contributor
Author
|
The failing test is a CI issue, it couldn't pull redis image so didn't complete. If someone could re-run just that single one that'd be great. |
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.
tempest/class-variance- a PHP package for building component CSS class strings with variants, compound variants, slot support, and conflict-aware merging. Heavily inspired by CVA and Tailwind-Variants, but with the ability to extend and support other CSS frameworks also.Two flavours:
cv()— separator-based merging, framework-agnostic CSS, somewhat limited by default but can be extended to support other frameworks.tv()— builds oncv()with Tailwind-aware merging, aiming to provide the same outcomes as tailwind-merge.Main features
slot,variants,compoundVariantsanddefaultVariants,tempest/discovery,Why this? / Notes
This is the biggest bit of work I've done; it's based on a fork I put together over here but attempting to fully adopt Tempest paradigms for integration.
Previously discussed with innocenzi in the discord about whether this would be welcome as a contrib ... so I hope you like it and I'm happy to work on any and all feedback and suggestions.
Acknowledgements / license
All code that went into this from my original fork was released under the MIT license (not much in the end, but it was a rough basis). CVA and Tailwind-Variants are both JS-sphere packages and no actual code was taken from these, not even as a pseudo-conversion to PHP. It's a ground-up implementation of similar syntax, which delivers similar outcomes, and is separate code entirely, however this package could not exist without their work, and the work of their inspirations. There's also an import from a MIT-licensed tailwind-merge package, with acknowledgements in the comments therein.
(If suited, I can put together a detailed ACKNOWLEDGEMENTS.md for this package specifically?)