-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor/button v1 #64
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I do like this but there's a couple things. Like you mentioned, if we decide to use another ui component library, this is probably not needed. I think we should decide what we want to use. Second, I think with how the figma currently is, this would be more annoying because all the sizes are written in px in the figma, but I can see if that's a quick fix for design team in figma, to reference the size variants you mapped out here. There is something I need clarification on. Is there still going to be custom styles attached to the button for things outside of the color and size? I'm guessing that's where classname comes in. Another thing. I'm guessing the size is for the font size? What about font weight? |
sizes already come from figma, but we should surely make buttons a bit responsive because they seem kinda big.
Just add classes in 'className' and styles will be rewritten nicely (or better say merged idk) thanks to
according to figma, font-weight is 600 (I think for every size but I need to double check) so I included |
I guess my main question is if it needs to be extended to add a font weight, is that easily doable? I haven't looked at the details of how this works yet. It looks like it should be easy enough to do. Another question, does this specifically have to be a regular dependency (instead of dev dependency)? Considering Tailwind is a dev dependency, I don't see why this can't be. |
easy, just add any classes to
The same can be done with
idk, probably |
Can you fix the conflicts. This is good to merge after that. |
Description
I've recently came across
clsx + twMerge
(to efficiently merge Tailwind CSS classes in JS without style conflict) and CVA. So I createdButtonCVA
with some variants (basically one for color, one for size, but I think we can create one for horizontal allignment and maybe try to style an icon inside it too, just to avoid using custom styles at all... well if we want).I used this Figma component as a base.
So this just something to consider, we might want to use smth like this or not. If we go for some UI library, we might not need it at all, even though I think
clsx + twMerge
combination is kinda cool. Current input/textarea components can use smth like this, we have a lot of conditional styling there.Issue link
Fixes # (issue)
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: