-
Notifications
You must be signed in to change notification settings - Fork 158
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
Feature Request: Unstyled Buttons #1116
Comments
I was able to avoid using !important to fully style the button by targeting the span inside the buttons, but this took me a bit of playing around before it became evident that I needed to target the span within the wallet button. I don't know if it's possible, but it would be really nice if I could style everything with the button class, without the span, because I have my buttons styled in my MaterialUI theme. Adding here because I don't know if this deserves it's own issue 🫠 |
@mykcryptodev and @0xGurmy can you share code example of your experience. I have a few ideas on how to solve this, but i would like to get more info on your experience first. |
@Zizzamia here is an example that I whipped up Here are two buttons where I provide the same style (btn btn-primary). if I look at the elements that are being created for the connect wallet button, there is a span within the button that styles text size, text color and tracking of the button label. Another solution could be limiting nested tags within components that override classes passed in from props. Here is the example app branch |
@mykcryptodev so to give more control on this particular case, we are going to explore a new component added to the Wallet family, Here the PR #1222 You are going to use it by doing <ConnectWallet>
<ConnectWalletText>Connect Wallet 🌊</ConnectWalletText>
<Avatar address={address} className="h-6 w-6" />
<Name />
</ConnectWallet> This is not a perfect solution, but for sure is a step forward to the More I think about this, and more I am realizing that the For now we are not deprecating the Oh, and I am going to close this Issue after we land this in the next version and I will have updated the docs. |
Understood. thanks for considering this! So it sounds like the prevailing idea is to give the developer control over each nested element within an onchainkit component. In this example, the span element that styles the connect button text can be styled by including the component and applying classes there. It sounds like if this pattern continues throughout onchainkit, there would be a world where if I wanted to style the text of a , there would be a component? Is that the idea? |
Yeah, at least for now seems the most balanced way. But, it's fair to stay vigilant on this design decision and keep re-evaluate that overtime. |
@mykcryptodev great call out, but here 2 points: Point 1
and it will work, no? That's the all point of having sub components you can directly control. Point 2 |
@Zizzamia that does work. I have to get used to the pattern of having sub-components. Thanks for the tip
Agreed. Thanks for that update! |
Describe the solution you'd like
Allow me to pass a prop to a button like TransactionButton that removes all styling so that I can be sure that my classNames are the only styles applied.
Describe alternatives you've considered.
I've tried fiddling with classNames and using !important to try to get my custom styles to be applied as desired but it would be much easier if I could tell onchainkit to be styleless
The text was updated successfully, but these errors were encountered: