-
Notifications
You must be signed in to change notification settings - Fork 121
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
Buttons Icons don't respect styles #2615
Comments
Hi. |
hi @JavanPoirier you can't pass the number value to size prop of |
I understand that a number is not "technically" supported by documentation or the types. However it does actually work across platforms and is the only way to workaround #1821 as I mention in this ticket. I believe this to do with the size prop being passed to the underlying SVG. Here is the workaround I implemented in the Gluestack UI component: I have not dug much deeper, however I suspect it is due to size being passed directly to the SVG, while height & width as specified with nativewind only affect the container. Suggesting a possible issue with the SVG viewport? #1821 only appears with some icons. I know |
Description
Icon sizing and styling issue
CodeSandbox/Snack link
none
Steps to reproduce
Updated this ticket to cover more styling issues with button icons. The Icon does not take the configured styling, and only works if specified on the component:
Original related issue:
Related bug: #1821
The workaround is to use a number value as the size on a Icon component. This works to display the icon correctly (granted not supported by the types), one side effect of this is that certain styles applied are omitted with variants. Margin in my case.
I have the following button:
And the following variant:
Without size, the Icon will not render correctly however the margin from the variant is applied. If I add the size, the margin is omitted.
Workaround is the apply the margin in line with the component use. No variant support.
gluestack-ui Version
v2
Platform
Other Platform
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: