-
Notifications
You must be signed in to change notification settings - Fork 738
clarification on how to use svg in native #5647
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
base: development
Are you sure you want to change the base?
Conversation
clarification on how to use svg in native
Hi Jason. Can you give me a little context for your rationale behind these changes? I'm especially curious about the longer code snippet you introduce and then pare back. |
When trying to build this out, I had to troubleshoot what worked and what not because there was no clear "before and after" code that was exported from figma, to code that worked in reactnative. I hope that showing a before and after will help people understand what elements can be removed from the code. also having the stroke class still in there in the example confused me. |
Thanks for the suggestion! I like that you want to make the example more realistic by using a Figma export. Maybe we can extend that and use something more interesting than just a rectangle that actually makes good use of preserving fill/stroke somewhere? Also could you explain the other changes you made? Why change the viewBox? Why remove the other svg attributes? |
@@ -33,16 +33,30 @@ We suggest manually removing these elements from your SVGs, or using the tools m | |||
|
|||
## 4 Styling SVGs | |||
|
|||
You might want to change certain colors in your SVG, for example when adding an image. Mendix allows you to do this by setting the `fill` and `stroke` properties in image's styling. These properties will then be applied to *all* the elements inside the SVG that do not have these properties. | |||
You might want to change certain colors in your SVG, for example when adding an icon. Mendix allows you to do this by setting the `fill` and `stroke` properties in image's styling of the .js. These properties will then be applied to *all* the elements inside the SVG that do not have these properties. |
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.
SVGs can also be used for other things (not only icon) so we should not change this here.
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.
Also styling of the .js seems wrong - we are not styling javascript.
clarification on how to use svg in native