software-mansion / react-native-svg

SVG library for React Native, React Native Web, and plain React web projects.
MIT License
7.35k stars 1.11k forks source link

Inkscape export troubles #1402

Open KVinS opened 4 years ago

KVinS commented 4 years ago

Hello! This library provides great opportunities, but I have two problems with my editor:

The library draws nothing if the line color is not specified.

The library draws such lines in black.

Maybe there is some kind of setting for export? Like... "do not use gradients", "always indicate color".

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

patriksletmo commented 3 years ago

@KVinS Not sure if you're still experiencing issues here, but I'm posting anyway for future reference. You can specify default colors in the SVG root element which will be applied to every element without an explicitly set fill or stroke. If you import your SVG file as a React element you can do it like this:


import MyVector from "./MyVector.svg";

const MyComponent = () => {
  return <MyVector fill="#000000" stroke="#000000" />;
};
WoLewicki commented 1 year ago

As for the problem with fill, the discussion and a fix is provided here: https://github.com/software-mansion/react-native-svg/issues/1543. As for the problem with colors as gradients, could you provide a repro of this so we could elaborate more?

bohdanprog commented 1 week ago

Hello @KVinS @patriksletmo, Could you share an example of how we can reproduce? Thank you