-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[docs][base] Add Tailwind CSS + plain CSS demo on the Button page #38240
[docs][base] Add Tailwind CSS + plain CSS demo on the Button page #38240
Conversation
Netlify deploy previewBundle size report |
<Button | ||
className="cursor-pointer disabled:cursor-not-allowed text-sm bg-violet-500 text-white rounded-md font-semibold px-4 py-2 border-none disabled:opacity-50" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Button | |
className="cursor-pointer disabled:cursor-not-allowed text-sm bg-violet-500 text-white rounded-md font-semibold px-4 py-2 border-none disabled:opacity-50" | |
<Button | |
className="cursor-pointer disabled:cursor-not-allowed text-sm bg-violet-500 text-white rounded-md font-semibold px-4 py-2 border-none disabled:opacity-50" |
We discussed that it would probably be better if we create a CustomButton
instead of adding all classes inline in each button's instance. For e.g.
const CustomButton = React.forwardRef((props, ref) => {
const { className, ...other } = props;
return (
<Button className={clsx("cursor-pointer disabled:cursor-not-allowed text-sm bg-violet-500 text-white rounded-md font-semibold px-4 py-2 border-none disabled:opacity-50", className)} {...other} ref={ref} />
)
});
I would propose to update all demos following this pattern. It's closer to how developers would do it in their project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mnajdova for the explanation. I pushed the changes that you suggested. I'll continue to work on other demos and components if you agree with the implementation :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent 👍 Nice job! In terms of order, I feel that the biggest impact we would make if we move the Introduction demos first on each components page, then we can slowly add the switcher to the other demos too :)
ab0a1da
to
2249cdf
Compare
Part of #37222