Skip to content

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

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

jasonteunissen
Copy link
Contributor

clarification on how to use svg in native

clarification on how to use svg in native
@ConnorLand
Copy link
Collaborator

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.

@jasonteunissen
Copy link
Contributor Author

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.

@jdiehl
Copy link
Contributor

jdiehl commented Feb 17, 2023

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.
Copy link
Contributor

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.

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants