goober icon indicating copy to clipboard operation
goober copied to clipboard

feat: add clsx utility as a subpackage

Open jakehamilton opened this issue 2 years ago • 2 comments

NOTE: These changes are quite similar to #236, but I've gone ahead and made a new PR based off of the latest changes on master.

Well, here we are again! I found some time to work on this clsx utility to let us combine & override classes. The current implementation is very similar to what I had in #236, but there are a few important notes here:

  1. Since I had separated clsx into its own subpackage, it now depends on goober exposing certain core utilities.
  2. With my current changes, goober now exposes an object core which contains the necessary functions for clsx to work.
  3. I've tried to keep the API change minimal so as not to confuse users. I think having a core export may be easier for a user to ignore than several functions, so that's why I've grouped the core utilities this way.

The test suite is actually the same one that I'd written in #236 and passes without any issue (yay)! In addition, I went and added information to the docs so folks can see instructions on the documentation site.


One thing to note is that I have not tested this change in a real application yet. My work here was purely porting the code from #236 in order to target master again. @cristianbote, might want to give 'er a try before we consider merging this.

jakehamilton avatar Jul 26 '21 04:07 jakehamilton

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/cristianbote/goober-rocks/4iPkVTDDkaqGTrp6LH8n4z93o2we
✅ Preview: https://goober-rocks-git-fork-jakehamilton-feat-cls-8f19be-cristianbote.vercel.app

vercel[bot] avatar Jul 26 '21 04:07 vercel[bot]

It looks like the filesize check is failing, but I'm not sure why or how to fix that. Might need some help there 😅

jakehamilton avatar Jul 26 '21 21:07 jakehamilton

This PR has sat around for a while so I'll be closing it. If anyone wants to pick this feature up, please feel free to use the code here!

jakehamilton avatar Feb 06 '24 11:02 jakehamilton